Tim Peters wrote: > > Here in current CVS Python: > > >>> import binascii > >>> binascii.hexlify(u'a') > '6100' > >>> > > In 2.1.1, it's '61' instead. I don't know what ought to happen, but 2.1.1 > suprised me less. binascii inherits its view of the argument via > PyArg_ParseTuple's t# code. Neither Unicode nor binascii has changed. For some reason the code in Python/getargs.c was changed in a way which removes the distinctin between "t#" and "s#" -- by delegating the actual buffer conversion to convertbuffer() only the bf_getreadbuffer slot gets used for both cases. Whether this is right or wrong is a different topic (binascii.hexlify() should probably work on the bf_getreadbuffer slot anyway since its normal usage is to encode binary data using HEX), but the change in getargs.c will certainly break existing code out there... -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4