-
Notifications
You must be signed in to change notification settings - Fork 21
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
Python 3 email package binary file handling is inconsistent #9
Comments
Looks like it might be just that FILE objects are either unicode or bytes variety now, and you have to pass the 'b' flag to get bytes. |
Yes, the email package only works correctly when you pass it a binary file. I haven't found a way to make it output a binary file, however! Will have to see how the as_bytes() method works. |
The test suite is surprisingly effective at getting all the StringIO changed to BytesIO and otherwise checking that all mail data io is 8-bit. |
This is problematic for packaging as well. The test code is written using the "from email import message_from_binary_file", but that is available only in python 3.2+ so can't be used for testing functionality of python27 or python30 version. |
Neither of which are supported anymore, so it's probably not a major concern. |
Not entirely unrelated, I'm finding the changes in 1.0.5 are helping a lot with non-UTF-8 content in email. |
Once again, we are back to python2.2 levels of bugginess in the email package for python3. Here is a basic test that needs to work:
Apparently all the test cases I provided for python2.2 with Evil™ emails have been dropped.
We'll have to debug the email package in python3, then dynamically patch it like we had to for 2.2 and 2.3.
The text was updated successfully, but these errors were encountered: