fix: archive extraction fails for target paths with non-ASCII characters on Windows (#3607)

Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
Ciarán O'Brien 2026-01-24 10:03:51 +00:00 committed by GitHub
parent 49b8324bbf
commit afc694c122
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View file

@ -1,6 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
"runtime.version": "Lua 5.4",
"runtime.special": {
"fail": "error"
},
"workspace.library": ["~/.config/yazi/plugins/types.yazi/"],
"diagnostics.disable": ["redefined-local"]
}

View file

@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
## [Unreleased]
### Fixed
- Archive extraction fails for target paths with non-ASCII characters on Windows ([#3607])
## [v26.1.22]
### Added
@ -1612,3 +1616,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
[#3566]: https://github.com/sxyazi/yazi/pull/3566
[#3582]: https://github.com/sxyazi/yazi/pull/3582
[#3594]: https://github.com/sxyazi/yazi/pull/3594
[#3607]: https://github.com/sxyazi/yazi/pull/3607

View file

@ -99,10 +99,9 @@ function M:tidy(from, to, tmp)
fail("Failed to determine a target for '%s'", from)
end
target = tostring(target)
if only and not os.rename(tostring(outs[1].url), target) then
if only and not fs.rename(outs[1].url, target) then
fail('Failed to move "%s" to "%s"', outs[1].url, target)
elseif not only and not os.rename(tostring(tmp), target) then
elseif not only and not fs.rename(tmp, target) then
fail('Failed to move "%s" to "%s"', tmp, target)
end
fs.remove("dir", tmp)