From afc694c12211185b6d97e567e2f044f77ecd70a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20O=27Brien?= Date: Sat, 24 Jan 2026 10:03:51 +0000 Subject: [PATCH] fix: archive extraction fails for target paths with non-ASCII characters on Windows (#3607) Co-authored-by: sxyazi --- .luarc.json | 3 +++ CHANGELOG.md | 5 +++++ yazi-plugin/preset/plugins/extract.lua | 5 ++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.luarc.json b/.luarc.json index f68d3f55..53b151a1 100644 --- a/.luarc.json +++ b/.luarc.json @@ -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"] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b9eaca8..03c08279 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/yazi-plugin/preset/plugins/extract.lua b/yazi-plugin/preset/plugins/extract.lua index d271f3cd..f2cfbb28 100644 --- a/yazi-plugin/preset/plugins/extract.lua +++ b/yazi-plugin/preset/plugins/extract.lua @@ -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)