-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-cola failed to launch when source tree is under non-ASCII directory under Windows #305
Comments
…essage If the supplied repo contains unicode characters we would error out when writing to stderr because the encodings don't match. Let the core.stderr() function handle it. Related-to: #305 Reported-by: V字龍(Vdragon) <pika1021@gmail.com> Signed-off-by: David Aguilar <davvid@gmail.com>
Well, I was able to fix that error message based on the traceback, but I can't reproduce this one because I'm probably using utf-8 filesystem paths. Do you know whether the filesystem paths are using a non-utf-8 encoding? I know Git itself has issues with non-utf-8 filesystem paths, and we do a lot of encoding/decoding of strings which forces us to require utf-8 for the filesystem itself. We would need a way to get the filesystem encoding, it seems. I can try using os.getcwdu() instead of os.getcwd() as well, since that might help as well. Yep, unicode is hard ;-) |
decode()/encode() is lossy when using non-utf-8 filesystems. Use getcwdu() to avoid an extra conversion. Related-to: #305 Signed-off-by: David Aguilar <davvid@gmail.com>
Replace all uses of os.getcwd() with core.getcwd() so that we get the proper unicode-friendly behavior. Related-to: #305 Signed-off-by: David Aguilar <davvid@gmail.com>
I added another tweak so that we avoid a decode()/encode() round trip when getting the repository path. Would you mind testing this again? There's a hope that this may have fixed this issue. Unfortunately we may need to require utf-8 filesystem paths, but we'll see if this helps since it may make a difference. (crossing my fingers ;-)) |
I just tried to make it work, it might be wrong/dangerous/garbage. Please review. Signed-off-by: V字龍(Vdragon) <pika1021@gmail.com>
The filesystem itself(NTFS) probably using UTF-16 however I suspect that os.getcwdu() should be fine dealing with this without caring which encoding are used under the hood.
I still get the exact same traceback using version c2dd395 |
Using the stdout and stderr encodings causes unicode encode errors on Windows. Use utf-8 when writing to stdout and stderr to fix writing unicode error messages to the shell. Related-to: #305 Helped-by: V字龍(Vdragon) <pika1021@gmail.com> Signed-off-by: David Aguilar <davvid@gmail.com>
Reproduce steps
make; make prefix=軟體\git-cola install
cd 軟體\git-cola
python bin/git-cola
Traceback
Reporter's environment
The text was updated successfully, but these errors were encountered: