[issue17171] email.encoders.encode7or8bit does not work with binary data

2013-02-11 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17171
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17171] email.encoders.encode7or8bit does not work with binary data

2013-02-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f83581135ec4 by R David Murray in branch '3.2':
#17171: fix email.encoders.encode_7or8bit when applied to binary data.
http://hg.python.org/cpython/rev/f83581135ec4

New changeset cabcddbed377 by R David Murray in branch '3.3':
Merge: #17171: fix email.encoders.encode_7or8bit when applied to binary data.
http://hg.python.org/cpython/rev/cabcddbed377

New changeset a80b67611c6d by R David Murray in branch 'default':
Merge: #17171: fix email.encoders.encode_7or8bit when applied to binary data.
http://hg.python.org/cpython/rev/a80b67611c6d

New changeset e44fa71d76fe by R David Murray in branch '2.7':
#17171: backport behavior-confirming test from python3.
http://hg.python.org/cpython/rev/e44fa71d76fe

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17171
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17171] email.encoders.encode7or8bit does not work with binary data

2013-02-11 Thread R. David Murray

R. David Murray added the comment:

Since this was straightforwardly similar to the issue 16564 fix I didn't bother 
with a review.  The 2.7 commit is backporting the behavior-confirming test, 
just for thoroughness.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17171
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17171] email.encoders.encode7or8bit does not work with binary data

2013-02-09 Thread R. David Murray

New submission from R. David Murray:

Reported by Serhiy in issue 16564:


 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):
  File stdin, line 1, in module
  File /home/serhiy/py/cpython3.2/Lib/email/generator.py, line 91, in flatten
self._write(msg)
  File /home/serhiy/py/cpython3.2/Lib/email/generator.py, line 137, in _write
self._dispatch(msg)
  File /home/serhiy/py/cpython3.2/Lib/email/generator.py, line 163, in 
_dispatch
meth(msg)
  File /home/serhiy/py/cpython3.2/Lib/email/generator.py, line 393, in 
_handle_text
if _has_surrogates(msg._payload):
TypeError: can't use a string pattern on a bytes-like object

--
components: email
messages: 181748
nosy: barry, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: email.encoders.encode7or8bit does not work with binary data
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17171
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com