nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
106.65k stars 29.08k forks source link

v22.6.0 fs.cpSync crash #54476

Open wxfred opened 1 month ago

wxfred commented 1 month ago

Version

v22.6.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

fs

What steps will reproduce the bug?

fs.cpSync will crash if the dir contains chinese, like fs.cpSync('C:/新建文件夹', 'C:/model', { recursive: true })

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

fs.cpSync can handle the dir with chinese

What do you see instead?

no output, only crash

Additional information

No response

wxfred commented 4 weeks ago

fs.cpSync in v20.17.0 is no error. And v20.17.0 has the new feature --experimental-require-module too, it saved me, thanks.

joyeecheung commented 4 weeks ago

Likely a regression caused by https://github.com/nodejs/node/pull/53614 - this only shows up on Windows where the native encoding is UTF16. It's possibly caused by the incorrect use of UTF8 path data https://github.com/nodejs/node/pull/53614#discussion_r1726683912

anonrig commented 2 weeks ago

cc @nodejs/platform-windows