Closed NiklasVousten closed 3 years ago
Thanks for the traceback. I have already found the problem (though do not yet know what the best solution is). It seems like python cannot encode the name of the node. A minimal working example should be print("o\u0308")
.
The sequence o%CC%88
is the url encoded value for ö
(o\xcc\x88
). Note that this is different from the variant \xc3\xb6
which stands also for ö
. These are two different unicode representations of the same character.
I made a small script to demonstrate this:
However I am not sure how we should solve this. We could always normalize these to the NFC
unicode form but that would also lead to different filenames and potentially redownloading them.
Sadly I currently do not have a windows machine at hand and this works under linux as this depends on the terminal encoding. Should you have access to another terminal emulator (and shell) you might try if the minimal example I gave above works in some of them e.g. the new Windows Terminal or an embedded terminal in some IDE (in combination with powershell.exe though it should depend on the terminal).
Okay after I found out about PEP 528 it seems that this should no longer be the case if you are running a modern version of python. Could you please check and tell me which version you have installed?
PS: Based on your traceback it seems like you are using 3.9 - is that correct? Did you maybe redirect the output to a file?
Correct. Im using python 3.9 inside a virtual environment. But i think I have started it inside the git bash terminal. I'll try with a different terminal on windows. Maybe it is a git bash problem
Edit: It works in powershell, the files got downloaded. So the problem is the git bash on windows
I am inclined to close this as a wontfix. While we could check the encoding of the terminal and encode every string with the backslashreplace
fallback this is not really a clean solution. Given that this seems to only happen in the git-bash terminal (and for a colleague of mine not event there) and the workaround is rather simple this is not worth the effort. Additionally I have a branch laying around on which the remaining prints are replaced with logging statements which are written to stderr by default which should always use the backslashreplace
.
When syncing old data, errors with unicode or the codec are thrown: