Alexander Kruppa added the comment:
Opened #19003.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16564
___
___
Python-bugs-list mailing list
Alexander Kruppa added the comment:
It seems to me that this issue is not fixed correctly yet. I've tried Python
3.3.2:
~/build/Python-3.3.2$ ./python --version
Python 3.3.2
When modifying the test case in Lib/test/test_email/test_email.py like this:
--- Lib/test/test_email/test_email.py
R. David Murray added the comment:
That's a different bug, and is probably due to the fact that \x0b is considered
a line-ending character by the 'splitlines' method.
Could you please open a new issue for this? It could be that this can't be
fixed in Python3 until support for the 'binary'
Roundup Robot added the comment:
New changeset 64e004737837 by R David Murray in branch '3.3':
#18324: set_payload now correctly handles binary input.
http://hg.python.org/cpython/rev/64e004737837
--
___
Python tracker rep...@bugs.python.org
Roundup Robot added the comment:
New changeset 14fe7a98b89c by Serhiy Storchaka in branch '3.2':
Issue #16564: Fixed a performance regression relative to Python 3.1 in the
http://hg.python.org/cpython/rev/14fe7a98b89c
New changeset 4b4670d0 by Serhiy Storchaka in branch '3.3':
Issue #16564:
Changes by Terry J. Reedy tjre...@udel.edu:
--
Removed message: http://bugs.python.org/msg184352
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16564
___
Roundup Robot added the comment:
New changeset 30f92600df9d by R David Murray in branch '2.7':
#16564: test to confirm behavior that regressed in python3.
http://hg.python.org/cpython/rev/30f92600df9d
New changeset a1a04f76d08c by R David Murray in branch '3.2':
#16564: Fix regression in use of
R. David Murray added the comment:
I've opened issue 17171 for the similar encode7or8bit problem.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
Looking at the documentation, it is clear that (a) what you are trying to do is
documented as being correct and (b) it worked in Python2, making this a
regression.
I've attached a patch to fix this, which also probably fixes some bugs with
BytesGenerator
R. David Murray added the comment:
Updated patch after review by Ezio and Serhiy.
--
Added file: http://bugs.python.org/file28990/encode_noop.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16564
Serhiy Storchaka added the comment:
import io, email
bytesdata = b'\xfa\xfb\xfc\xfd\xfe\xff'
msg = email.mime.application.MIMEApplication(bytesdata,
_encoder=encoders.encode_7or8bit)
s = io.BytesIO()
g = email.generator.BytesGenerator(s)
g.flatten(msg)
Traceback (most recent call last):
R. David Murray added the comment:
While related, that is a different bug, so I'd rather open a new issue for it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16564
___
New submission from Alexander Kruppa:
I'm trying to use the email.* functions to craft HTTP POST data for file
upload. Trying something like
filedata = open(data, rb).read()
postdata = MIMEMultipart()
fileattachment = MIMEApplication(filedata, _encoder=email.encoders.encode_noop)
R. David Murray added the comment:
Yes, the way BytesGenerator works is basically a hack to get the email package
itself working. Use cases outside the email package were not really considered
in the (short) timeframe during which it was implemented.
The longer term plan calls for redoing
R. David Murray added the comment:
Hmm. Let me rephrase that. *Internally* it doesn't support bytes payloads, it
encodes bytes payloads as surrogateescaped ascii, as you have oserved. Which
is why this is on the borderline, and could possibly be considered a bug fix,
because from an
15 matches
Mail list logo