Skip to content
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

ordinal not in range(128) #24

Closed
cscholz opened this issue Jan 9, 2016 · 7 comments
Closed

ordinal not in range(128) #24

cscholz opened this issue Jan 9, 2016 · 7 comments

Comments

@cscholz
Copy link

cscholz commented Jan 9, 2016

Today one send forwarded me a bounce message from generated from zeple.
For the moment I don't have the original message send to zeyple to track the issue down.
The error reported is:

Command died with status 1: "/usr/local/bin/zeyple.py".
Command output: Traceback (most recent call last):
File "/usr/local/bin/zeyple.py", line 386, in zeyple.process_message(message, recipients) File "/usr/local/bin/zeyple.py", line 198, in process_message out_message = self._encrypt_message(in_message, key_id)
File "/usr/local/bin/zeyple.py", line 255, in _encrypt_message payload = payload.encode('ascii') UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 621: ordinal not in range(128)

@acatton
Copy link
Collaborator

acatton commented Jan 9, 2016

I think this is related to #22. I haven't time to take a look at it, and I won't have time in the next month for personal reasons.

What would be helpful, if it's not too private would be to have the original email that has been sent. Do you have this?

@cscholz
Copy link
Author

cscholz commented Jan 11, 2016

I've aksed the sender to send the email again and the message produced the same issue. Then I've disabled zeyple and he send the message again. So the message that I've got now could help to trace down the issue. I'll send you the message to your email adress used in your github profile.

@infertux
Copy link
Owner

Hey @acatton, keen to get your feedback on this. How do you usually solve those nasty ASCII/Unicode issues in Python while keeping compatibility for both Python 2 and 3? This comes up regularly and is a big PITA. Is it worth adding six as a runtime dependency and forget about it once and for all?

@infertux
Copy link
Owner

(Duplicate of #22)

@acatton
Copy link
Collaborator

acatton commented Mar 30, 2016

@infertux this problem is solved differently. Usually peope use six, but still get the bug. Some people use 3to2.

Put I think here the real problem is bad typing. My goal is to make Zeyple 2.0 readable by mypy with [Python 2 annotations)(https://mypy.readthedocs.org/en/latest/python2.html) so that we get a better typing. I think the problem here is that nobody knows when is something unicode or byte. Type annotation (+ type checking) will solve the issue once and for all (IMHO).

@infertux
Copy link
Owner

@acatton Thanks for the quick reply! Yeah IIRC the pgpme library spits out different types depending if you're running Python 2 or 3 which is pretty annoying...

The type check idea sounds great. Meanwhile I'll see if I can fix that crap for Zeyple v1... Or maybe rewrite it in Ruby 😜

@infertux
Copy link
Owner

Hi @cscholz,

Thanks for your patience. This should be fixed now (please reopen the issue if not).

Here's a helper script to upgrade to v1.2.0: https://github.com/infertux/zeyple/blob/master/upgrade.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants