[issue4757] reject unicode in zlib

2010-01-09 Thread STINNER Victor
STINNER Victor added the comment: > The patch was committed to py3k and 3.1. Thank you! r76836 and r76838 -- ___ Python tracker ___ _

[issue4757] reject unicode in zlib

2009-12-14 Thread flox
Changes by flox : Removed file: http://bugs.python.org/file1/issue4757_zlib_bytes.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4757] reject unicode in zlib

2009-12-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch was committed to py3k and 3.1. Thank you! -- resolution: accepted -> fixed status: open -> closed ___ Python tracker ___ _

[issue4757] reject unicode in zlib

2009-12-14 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: -> pitrou resolution: -> accepted ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue4757] reject unicode in zlib

2009-12-14 Thread flox
flox added the comment: Fixed. And some "bytearray" tests improved in test_zlib. -- Added file: http://bugs.python.org/file15556/issue4757_zlib_bytes_v2.diff ___ Python tracker

[issue4757] reject unicode in zlib

2009-12-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch produces a number of errors in test_tarfile, test_distutils, test_gzip and test_xmlrpc. -- ___ Python tracker ___

[issue4757] reject unicode in zlib

2009-12-14 Thread flox
flox added the comment: Patch from haypo updated for r76830 . Additional tests for TypeError, and to check that bytearray objects are accepted. -- Added file: http://bugs.python.org/file1/issue4757_zlib_bytes.diff ___ Python tracker

[issue4757] reject unicode in zlib

2009-12-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch lacks a test that TypeError is raised on unicode input, otherwise it's fine. -- ___ Python tracker ___ ___

[issue4757] reject unicode in zlib

2009-12-14 Thread flox
flox added the comment: Definitely, zlib.compress should raise a TypeError (like bz2 does). >>> import bz2, zlib >>> bz2.compress('abc') Traceback (most recent call last): File "", line 1, in TypeError: argument 1 must be bytes or buffer, not str >>> zlib.compress('abc') b"x\x9cKLJ\x06\x00\x

[issue4757] reject unicode in zlib

2009-01-05 Thread STINNER Victor
STINNER Victor added the comment: > > I propose to reject unicode in Python 3.x and display a warning for > > Python 2.x. A warning to prepare the migration... not to Unicode, but to > > Python3 ;-) > > Fair enough. The patch for Python 3.x is already attached to this issue. We might only appl

[issue4757] reject unicode in zlib

2009-01-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 2009-01-04 23:51, STINNER Victor wrote: > STINNER Victor added the comment: > >> The fact that Python 2.x also accepts Unicode ASCII strings >> where strings are normally expected is intended to help with >> the migration to Unicode > > I hate this b

[issue4757] reject unicode in zlib

2009-01-04 Thread Lukas Lueg
Lukas Lueg added the comment: The current behaviour may help the majority by ignorance and cause weird errors for others. We tell people that Python distincts between Text and Data but actually treat it all the same by implicit encoding. Modules that only operate on Bytes should reject Unicode-

[issue4757] reject unicode in zlib

2009-01-04 Thread STINNER Victor
STINNER Victor added the comment: > The fact that Python 2.x also accepts Unicode ASCII strings > where strings are normally expected is intended to help with > the migration to Unicode I hate this behaviour. It doesn't help migration, it's the opposite! Sometimes it works (ASCII), and somti

[issue4757] reject unicode in zlib

2008-12-27 Thread ebfe
ebfe added the comment: I don't think Python 2.x should be changed - but 3.0 or 3.1 should be: - Characters don't mean a thing in zlib-land, all operations are based on bytes and their (implicit) default encoding. This behaviour is hidden and somewhat violates the rule of least surprise. - ty

[issue4757] reject unicode in zlib

2008-12-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 2008-12-27 13:58, STINNER Victor wrote: > Python 2.x allows to encode any byte string (str) and ASCII unicode > string (unicode): > > $ python > Python 2.5.1 (r251:54863, Jul 31 2008, 23:17:40) import zlib zlib.compress('abc') > "x\x9cKLJ\x06\

[issue4757] reject unicode in zlib

2008-12-27 Thread STINNER Victor
STINNER Victor added the comment: See also issue #4738 (better threads support in zlib). -- nosy: +ebfe, pitrou ___ Python tracker ___ ___

[issue4757] reject unicode in zlib

2008-12-27 Thread STINNER Victor
New submission from STINNER Victor : Python 2.x allows to encode any byte string (str) and ASCII unicode string (unicode): $ python Python 2.5.1 (r251:54863, Jul 31 2008, 23:17:40) >>> import zlib >>> zlib.compress('abc') "x\x9cKLJ\x06\x00\x02M\x01'" >>> zlib.compress(u'abc') "x\x9cKLJ\x06\x00\