[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-11-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset f3d8bb3ffa98 by Stefan Krah in branch '3.5': Iaaue #25598: Fix memory_hex from #9951 for non-contiguous buffers. https://hg.python.org/cpython/rev/f3d8bb3ffa98 -- ___ Python tracker

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-26 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: commit review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: i missed the hg adds :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list mailing

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: bytes.hex-1.diff looks good, i'll take care of committing this and adding a what's new entry. thanks! -- assignee: ncoghlan - gregory.p.smith nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 955a479b31a8 by Gregory P. Smith in branch 'default': Issue9951: update _hashopenssl and md5module to use _Py_strhex(). https://hg.python.org/cpython/rev/955a479b31a8 -- ___ Python tracker

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset c9f1630cf2b1 by Gregory P. Smith in branch 'default': Implements issue #9951: Adds a hex() method to bytes, bytearray, memoryview. https://hg.python.org/cpython/rev/c9f1630cf2b1 -- nosy: +python-dev ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- resolution: - fixed stage: patch review - commit review status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7f0811452d0f by Gregory P. Smith in branch 'default': Switch binascii over to using the common _Py_strhex implementation for its hex https://hg.python.org/cpython/rev/7f0811452d0f -- ___ Python tracker

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset a7737204c221 by Gregory P. Smith in branch 'default': Add the files missing from c9f1630cf2b1 for issue9951. https://hg.python.org/cpython/rev/a7737204c221 -- ___ Python tracker rep...@bugs.python.org

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: note quite fixed, looks like some of the buildbots are having fun not compiling with this change: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/9569/steps/compile/logs/stdio investigating... -- resolution: fixed - status: closed

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset b46308353ed9 by Gregory P. Smith in branch 'default': Add missing PyAPI_FUNC macro's to the public functions as other .c files do https://hg.python.org/cpython/rev/b46308353ed9 -- ___ Python tracker

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: I see some _Py_strhex related link errors on the Windows buildbots: http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/9642/steps/compile/logs/stdio -- ___ Python tracker rep...@bugs.python.org

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Nick Coghlan
Nick Coghlan added the comment: Thank you Arnon, and thank you Greg! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-25 Thread Arnon Yaari
Arnon Yaari added the comment: minor updates to stdtypes.rst. I also want to add a line to whatsnew/3.5 but don't know how to put it in words - maybe it's better if someone with better english will add it. -- Added file: http://bugs.python.org/file39204/bytes.hex-1.diff

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: -haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-13 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Removed file: http://bugs.python.org/file19175/bytes.hex.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-13 Thread Arnon Yaari
Arnon Yaari added the comment: I added the implementation for memoryview, updated to use PyUnicode_New etc., and moved the common implementation to its own file for code reuse. -- Added file: http://bugs.python.org/file38947/bytes.hex.diff ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-13 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Added file: http://bugs.python.org/file38961/bytes.hex.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-13 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Removed file: http://bugs.python.org/file38947/bytes.hex.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-13 Thread Nick Coghlan
Nick Coghlan added the comment: Arnon is here at the PyCon 2015 sprints, so bringing the current status up to date: = Why *.hex()? = * That's the name in PEP 358 * That's the name of the comparable float method = Why add it to the builtin types? = * To provide One Obvious Way To Do It,

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2015-04-13 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2014-11-07 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2014-09-23 Thread Nick Coghlan
Nick Coghlan added the comment: Updated issue title to indicate proposal also covers bytearray and memoryview. -- title: introduce bytes.hex method - introduce bytes.hex method (also for bytearray and memoryview) ___ Python tracker

[issue9951] introduce bytes.hex method (also for bytearray and memoryview)

2014-09-23 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list mailing

[issue9951] introduce bytes.hex method

2014-09-11 Thread Chris Lasher
Chris Lasher added the comment: int has int.from_bytes and int.to_bytes. Currently, bytes has bytes.fromhex. Would the core developers please consider naming the method bytes.tohex instead of bytes.hex, so there's at least a modicum of consistency in the method names of Python's builtin

[issue9951] introduce bytes.hex method

2014-09-11 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 11.09.2014 01:04, Nick Coghlan wrote: Nick Coghlan added the comment: Just as a recap of at least some of the *current* ways to do a bytes - hex conversion: import codecs codecs.encode(babc, hex) b'616263' import binascii

[issue9951] introduce bytes.hex method

2014-09-10 Thread Chris Lasher
Changes by Chris Lasher chris.las...@gmail.com: -- nosy: +gotgenes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method

2014-09-10 Thread STINNER Victor
STINNER Victor added the comment: New features cannot be added to Python 2 anymore, only to the current development version which is now Python 3.5. If new methods are added to bytes, they should be added to bytearray too. Maybe we should also consider add them to memoryview? memoryview has

[issue9951] introduce bytes.hex method

2014-09-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: To answer Serhiy, the goal is to have a bytes method that represents bytes as bytes rather than as a mixture of bytes and encoded ascii characters. This would aid people who work with bytes that are not encoded ascii and that do not embed encoded ascii. It

[issue9951] introduce bytes.hex method

2014-09-10 Thread HCT
HCT added the comment: @Victor binascii.hexlify('abc') doesn't work in 3.4. I assume this is a new thing for 3.5 import binascii binascii.hexlify('abc') Traceback (most recent call last): File stdin, line 1, in module TypeError: 'str' does not support the buffer interface

[issue9951] introduce bytes.hex method

2014-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: Just as a recap of at least some of the *current* ways to do a bytes - hex conversion: import codecs codecs.encode(babc, hex) b'616263' import binascii binascii.hexlify(babc) b'616263' import base64 base64.b16encode(babc) b'616263'

[issue9951] introduce bytes.hex method

2014-09-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: The proposal is to add a .hex method (similar to binascii.hexlify) that is the inverse of .fromhex (similar to binascii.unhexlify), as originally specified in PEP 358. http://legacy.python.org/dev/peps/pep-0358/ The object has a .hex() method that does the

[issue9951] introduce bytes.hex method

2014-09-10 Thread HCT
HCT added the comment: @Terry natural bytes do not have space between them. I would think adding space is for typesetting situation which should be done by user's post-processing. I agree to not have any prefix to make .hex and from_hex uniform. the \x is the str representation of bytes when

[issue9951] introduce bytes.hex method

2014-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: Good point Terry - I split the proposal to support bytes-like objects for 'x' and 'X' in string formatting out to issue 22385. For bytes.hex, I'm inclined to stick with the dirt simple option described in PEP 358: the exact behaviour of the current

[issue9951] introduce bytes.hex method

2014-09-10 Thread Nick Coghlan
Nick Coghlan added the comment: Open question: the current patch adds bytes.hex() and bytearray.hex(). Should we also add memoryview.hex(), or split that suggestion out to a separate proposal? -- ___ Python tracker rep...@bugs.python.org

[issue9951] introduce bytes.hex method

2014-09-10 Thread Mark Lawrence
Mark Lawrence added the comment: I'd say add memoryview.hex() here as everything seems related. Victor has also mentioned memoryview in msg226692. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951

[issue9951] introduce bytes.hex method

2013-12-09 Thread HCT
HCT added the comment: would be good if we can specify a optional flag to get all cap hex. currently, I have to do hexlify( some_bytes ).decode( 'UTF-8' ).upper(). would be good to be able to do some_bytes.hex( upper=1 ) -- nosy: +hct ___ Python

[issue9951] introduce bytes.hex method

2013-12-09 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2013-10-13 Thread Georg Brandl
Georg Brandl added the comment: Blasphemous question: why not give bytes a __hex__ method? Then you could use hex() to convert them :) The patch is outdated; it should not use PyUnicode_AS_UNICODE, but PyUnicode_New(..., 127) and then PyUnicode_1BYTE_DATA to get the char array. --

[issue9951] introduce bytes.hex method

2013-10-12 Thread Christian Heimes
Christian Heimes added the comment: I like to see the feature in 3.4, too. -- nosy: +christian.heimes stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2013-10-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: If it's the reverse of fromhex(), perhaps we should call it tohex()? -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2013-10-12 Thread Christian Heimes
Christian Heimes added the comment: Funny thing. I was searching for tohex when I found this ticket. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2013-09-13 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___

[issue9951] introduce bytes.hex method

2013-09-13 Thread Arnon Yaari
Arnon Yaari added the comment: You can follow the discussion I linked in the ticket description for an answer: http://psf.upfronthosting.co.za/roundup/tracker/issue3532 Mainly the answer is: to conform to PEP 358 and to provide the opposite of bytes.fromhex. I agree that you can use binascii,

[issue9951] introduce bytes.hex method

2013-07-14 Thread Arnon Yaari
Arnon Yaari added the comment: Hi, is there any chance to get this merged? This ticket has been open for almost 3 years... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2013-07-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are several ways to do this: base64.b16encode, binascii.a2b_hex, hex(int.from_bytes(...)), etc. Why you need yet one? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org

[issue9951] introduce bytes.hex method

2013-05-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: Also #3532 -- nosy: +terry.reedy versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2013-05-19 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method

2011-04-03 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: See also: issue11756 -- nosy: +rhettinger versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951

[issue9951] introduce bytes.hex method

2010-10-09 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Added file: http://bugs.python.org/file19175/bytes.hex.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2010-10-09 Thread Arnon Yaari
Changes by Arnon Yaari wiggi...@gmail.com: Removed file: http://bugs.python.org/file19018/bytes.hex.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2010-10-09 Thread Arnon Yaari
Arnon Yaari wiggi...@gmail.com added the comment: fixed to Py_UNICODE -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___

[issue9951] introduce bytes.hex method

2010-10-09 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- Removed message: http://bugs.python.org/msg117862 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___

[issue9951] introduce bytes.hex method

2010-10-02 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list mailing

[issue9951] introduce bytes.hex method

2010-10-02 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Patch generally looks good, but the type of retbuf is incorrect (should be Py_UNICODE* rather than wchar_t*). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951

[issue9951] introduce bytes.hex method

2010-09-27 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method

2010-09-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9951 ___ ___ Python-bugs-list

[issue9951] introduce bytes.hex method

2010-09-25 Thread Arnon Yaari
New submission from Arnon Yaari wiggi...@gmail.com: Following up on these discussions: http://psf.upfronthosting.co.za/roundup/tracker/issue3532 http://www.gossamer-threads.com/lists/python/dev/863892 I'm submitting a patch to add bytes.hex method in accordance to PEP 358. The code was taken