[issue24551] byte conversion

2015-07-08 Thread Zachary Ware
Changes by Zachary Ware : -- stage: -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue24551] byte conversion

2015-07-08 Thread Zachary Ware
Changes by Zachary Ware : -- components: -Demos and Tools ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue24551] byte conversion

2015-07-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm sorry, but I believe that you have misunderstood what happens here. This has nothing to do with the hex codec, or int.to_bytes() etc. This is the standard property of byte strings in Python, that they are displayed using ASCII as much as possible. The by

[issue24551] byte conversion

2015-07-08 Thread Padmanabhan Tr
Padmanabhan Tr added the comment: On Wednesday, July 8, 2015 7:56 PM, padmanabhan T R wrote: Dear Mr Steven D'ApranoI have not gone through the relevant Source Codes; purely based on my working with Python3 (Version 3.4.2) and the 'The Python Library Reference manual, Release 3.4.2' document

[issue24551] byte conversion

2015-07-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Bytes in Python 3 do use ASCII representation: py> b'\x41' == b'A' # ASCII True If you think the documentation is unclear, please tell us which part of the docs you read (provide a URL) and we will see if it can be improved. --

[issue24551] byte conversion

2015-07-06 Thread Padmanabhan Tr
Padmanabhan Tr added the comment: Dear Mr Steven D'ApranoThanks for your prompt response.I guess that 'b'\x00\x00 0' is the same as b'\x00\x00\x20\x30' if we take (space) as 20 & 0 as 30 as with ASCII / UTF-8 representation.  But if I go by 'Python Library Reference -Release version 3.4.2 (Sec

[issue24551] byte conversion

2015-07-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't know, what *is* the problem? What behaviour did you expect? The code sample you show seems to be working exactly as it is supposed to. b'\x00\x00 0' is the same as b'\x00\x00\x20\x30', and that is the same as b'\x20\x30' with NUL padding on the left.

[issue24551] byte conversion

2015-07-02 Thread Padmanabhan Tr
New submission from Padmanabhan Tr: I have copied below an execution sequence. What is the problem? >>> x = 8240 >>> x.to_bytes(4,byteorder='big') b'\x00\x00 0' >>> int.from_bytes(b'\x00\x00 0',byteorder='big') 8240 >>> int.from_bytes(b'\x20\x30',byteorder='big') 8240 >>> -- components:

[issue24551] byte conversion

2015-07-02 Thread Padmanabhan Tr
Changes by Padmanabhan Tr : -- nosy: Padmanabhan.Tr priority: normal severity: normal status: open title: byte conversion type: behavior versions: Python 3.4 ___ Python tracker _