This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ebfe
Recipients ebfe, lemburg, pitrou, vstinner
Date 2008-12-27.13:58:22
SpamBayes Score 1.0119893e-08
Marked as misclassified No
Message-id <1230386303.57.0.390922687682.issue4757@psf.upfronthosting.co.za>
In-reply-to
Content
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.
 - type(zlib.decompress(zlib.compress('abc'))) == bytes anyway
 - Changing from s* to y* forces the programmer to use .encode() on his
strings (e.g. zlib.compress('abc'.encode()) which very clearly shows
what's happening. If you want to compress and decompress Python3
strings, you *must* share the same character encoding; think of
zlib.compress('hôńè') and str(zlib.decompress(x)) with different locales.
 - Other modules (hashlib comes to my mind...) already reject Unicode
objects for the same argument.
History
Date User Action Args
2008-12-27 13:58:24ebfesetrecipients: + ebfe, lemburg, pitrou, vstinner
2008-12-27 13:58:23ebfesetmessageid: <1230386303.57.0.390922687682.issue4757@psf.upfronthosting.co.za>
2008-12-27 13:58:22ebfelinkissue4757 messages
2008-12-27 13:58:22ebfecreate