-
Notifications
You must be signed in to change notification settings - Fork 162
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 on starting alot #693
Comments
it seems you are using a terminal icapable of displaying utf-8 characters and also another sanity check: is your config file perhaps not encoded in utf-8? |
Terminal:
Turning of the translation of the tag
But the character can be displayed in alot itself, e.g. when I edit a new email and use the character as the content of the mail. |
your output
suggests that the string
somewhere in
I followed the code to see where we get the second string from, and it seems that the Just for comparison: i'm running
I think somewhere around the linked line in |
FTR: configobj development gained some momentum recently: |
i just updated to configobj 5.0.2 from pip, and i still get the same result (unicode strings everywhere). |
I am running configobj with version 5.0.2 as well. Interestingly, running your
For completeness, I tried to make sure that the character
Then cross-check the config:
Can you check the character representation on your system as well? Maybe the above is wrong? Maybe I will find more time next week to investigate further. Sorry for taking so long to respond, alot is happening right now (pun partly intended). |
Thats it! I involuntarily used configobj v4.7.2 when i used Quoting Magnus Müller (2014-04-02 22:01:50)
|
regarding utf8 chars in the config being read as str, not unicode in python v2.7. This pathc introduces an additional `alot.helper.string_decode` around the translated tagname read from the config, and fixes issue #693. In the long run, we expect configobj to be fully backweards compatible.
i pushed a work around to branch |
Great, thanks for debugging this. I will try the workaround as soon as possible. |
hello there, I'm one of the configobj maintainers, and wanted to put here as a backup, that I believe this issue would fixed as a result of the newly-release configobj 5.0.3 |
hi @robdennis! unfortunately, it seems this issue is not yet resolved, at least for me. |
This could be as a result of you not passing in encoding via a parameter to the constructor. By default files are left as byte strings, but passing in the encoding argument makes them Unicode (and will use that value to decode). The change in 5.0.3 was that encoding value wasn't being used and we'd default to using ASCII encoded Unicode. This is on display in the comment the other commenter (sorry, on my phone) posted. Sounds like for every constructor call of configobj, you probably want to set encoding='utf-8' On Mon, Apr 7, 2014 at 7:25 AM, Patrick Totzke notifications@github.com
|
This is a similar error to #673, but not quite the same. Backtrace:
The workaround from #637 (setting
LANG
) did not work here. I could work around by adding atry..except
around the comparison inalot/helper.py
:With this, I get the following output when starting
alot
:The text was updated successfully, but these errors were encountered: