[git] Use "backslashreplace" instead of "surrogateescape".#22
[git] Use "backslashreplace" instead of "surrogateescape".#22jgbarah wants to merge 1 commit intochaoss:mainfrom
Conversation
|
When I run the tests I get the next errors: |
|
I had forgotten about running all tests, sorry. But when I just did, curiously enough I get a different error: I'm going to fix this one (which is due to the change of encoding in case of exceptions when encoding), by changing the expected result. And then I will have a look at the errors that are raised for you... |
When decoding as utf8, if the character cannnot be decoded, use the backslashreplace error handler, instead of the surrogateescape error handler. Fixes chaoss#18 for git backend, maybe others should be fixed too.
|
I just git amend forced a new commit which in my side passes all tests: Would you mind checking once again? Maybe I missed something, but I cannot reproduce the problem you see... |
|
It's still failing but I found why. Looks like If we accept this change will mean Perceval will work only with Python 3.5. I don't see now any problems with it but for instance in Ubuntu 15.10, the default version is 3.4. |
|
Uhhhm. I hadn't noticed either :-( I can find another option, now that I sort of understand the problem, and produce some code dependent on Python being < 3.5. But maybe we could do that in separate PR, to make this trough and let it work in git repos such as that of the Linux kernel which need it... |
|
@sduenas do you think we could do this change, or something similar? If so, I can update the patch. Otherwise, we better close the PR. |
|
Here is way to do the same operation in Python 2 and Python 3 compatible way. |
When decoding as utf8, if the character cannnot be decoded,
use the backslashreplace error handler, instead of the
surrogateescape error handler.
Fixes #18 for git backend, maybe others should be fixed too.