[issue17868] pprint long non-printable bytes as hexdump

2015-12-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: fixed -> rejected ___ Python tracker ___

[issue17868] pprint long non-printable bytes as hexdump

2015-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Withdrawn in favor of issue17530. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue17868] pprint long non-printable bytes as hexdump

2013-05-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I forgot about bytes.fromhex(). This of course looks better than base64.b16decode((...).replace(' ', '')). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17868

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 1) A separate function might be better. I think this kind of output would be more useful while inspecting individual byte objects, rather than having it for arbitrary byte objects (that might be inside other containers). I don't think the general

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an alternative patch which outputs a bytes literal and a hexdump as a comment. -- Added file: http://bugs.python.org/file30121/pprint_bytes_hex_2.patch ___ Python tracker rep...@bugs.python.org

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le samedi 04 mai 2013 à 09:42 +, Serhiy Storchaka a écrit : However a simple specialized code can be used for special purposes, i.e. internally in the pprint module. I don't see how it can be reused and don't interested in a general function. I don't

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file30121/pprint_bytes_hex_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17868 ___

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file30122/pprint_bytes_hex_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17868 ___

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't understand how it would be useful in the pprint module if it can't be useful as a general function. How can it be used besides pprint/pformat functions? Just the nice way is different depending on the situations: if my bytes object is simply a

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't understand how it would be useful in the pprint module if it can't be useful as a general function. How can it be used besides pprint/pformat functions? I don't understand your question. Do you never print some data at the command-line prompt? Or

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Ezio Melotti
Ezio Melotti added the comment: The idea is that the output of pprint should be something like (once #17530 is applied): pprint.pprint(b'\x7fELF\x01\x01\x01\x00\x00\n\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00\x01') (b'\x7fELF\x01\x01\x01\x00\x00\n\x00\x00'

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't understand your question. Do you never print some data at the command-line prompt? Or even as part of small test programs? To be honest, I very rarely even use pprint. I'm too lazy to import it. If I want to quickly get a hexdump, I use something

[issue17868] pprint long non-printable bytes as hexdump

2013-05-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le samedi 04 mai 2013 à 15:41 +, Serhiy Storchaka a écrit : Which is why the proposal doesn't fit well with pprint/pformat. Perhaps I misunderstood your wish. I'm not against consider pprint as a black box, which does all good magic inside by default.

[issue17868] pprint long non-printable bytes as hexdump

2013-04-30 Thread anatoly techtonik
anatoly techtonik added the comment: Some issues: 1. the hex converting logic doesn't belong to base64 module - there is no chance a person without StackOverflow access can find it 2. i'd put issue17862 first as a dependency for this one, because proposed itertools.chunks() can be further

[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Here is a patch with which pprint formats long bytes objects which contain non-ascii or non-printable bytes as a hexdump. Inspired by Antoine's wish (http://permalink.gmane.org/gmane.comp.python.ideas/20329). -- components: Library (Lib) files:

[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Ezio Melotti
Ezio Melotti added the comment: A couple of comments: 1) A separate function might be better. I think this kind of output would be more useful while inspecting individual byte objects, rather than having it for arbitrary byte objects (that might be inside other containers). 2) I don't know

[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Fred L. Drake, Jr.
Changes by Fred L. Drake, Jr. fdr...@gmail.com: -- nosy: -fdrake ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17868 ___ ___ Python-bugs-list

[issue17868] pprint long non-printable bytes as hexdump

2013-04-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, I think a separate function would be better. There's another issue for pprint() of bytes with line continuations: http://bugs.python.org/issue17530 -- ___ Python tracker rep...@bugs.python.org