-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Error in moban 0.4.3 #265
Comments
0.4.3 read and write 0.3.3 uses shutils to copy. when reading in, if the file is not encoded in utf-8, this problem will rise. |
That is also what I suspected. So we can by default convert the file to utf-8 in this repo while reading? |
https://github.com/moremoban/moban/blob/dev/moban/copy/__init__.py Copy engine should have read with 'rb' flag and ignore encoding. Simple 'open' fuction should work. When saving, it should use 'wb' flag, treating the content as binary throughout the journey within moban. |
Ok, I will send a PR by tonight. |
@chfw This error is not yet fixed: https://gitlab.com/ayan-b/mobans/-/jobs/201319687 . It comes from https://github.com/moremoban/moban/pull/267/files#diff-4ce3d7a5af974a09dae6519b5a45cc44R65. If we ignore decoding python3 tests fail. Interestingly, the |
@chfw what do you think? |
I think you have just shifted decoding from copy engine to write function. In python 3, cannot we write bytes directly to a file? |
And it also means that the unit test case failed to capture the bug. |
By the way, I wonder if we can simply copy in these scenarios (where we are not touching the contents of the file) using |
I will try to solve the issue over the weekend. |
Using moban 0.4.3, we get this error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
in the coala-mobans repo, although this error does not arise with moban 0.3.3.CI log:
The text was updated successfully, but these errors were encountered: