-
Notifications
You must be signed in to change notification settings - Fork 22
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
UnicodeDecodeError: 'gbk' codec can't decode: #89
Comments
Hum. I need to think about this one. I think That being said, maybe I'm wrong. In that case, we should use At any rate, I'm pretty sure that just patching this one line is not enough. What do you think ? |
Hi,
Sometimes a file do not follow the system encoding, in that case the only
way is to specify the encoding somehow. Also calling encode/decode on such
a file will probably fail.
…On Tue, Mar 30, 2021, 19:11 Dimitri Merejkowsky ***@***.***> wrote:
Hum. I need to think about this one.
I think tbump uses .encode() and .decode() without special arguments
everywhere. In theory, tbump should use the default encoding of the
platform it is running on and work out of the box everywhere, regardless of
how your the source files are encoded.
That being said, maybe I'm wrong. In that case, we should use encode()
and decode() with the utf-8 encoding explicitly set everywhere and
document that tbump only works for UTF-8 encodings.
At any rate, I'm pretty sure that just patching this one line is not
enough.
What do you think ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAL75NGN4VEJDNQUUDPTE3TGHZ3PANCNFSM4Z4QBWRA>
.
|
Not too sure, but I patched that line and everything is fine it seems. |
Yeah but you should not have to! It would be good to reproduce and figure out the root cause but I don't have access to a Windows machine that uses the I don't want to merge a patch that hard-codes Let's ask for help. |
A simple patch in file_bumper.py", line 219 fixes the problem:
file_path.read_text()
->file_path.read_text("utf8")
It would be nice if the next version adds this "utf8".
The text was updated successfully, but these errors were encountered: