[issue29000] Not matched behavior within printf style bytes formatting

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +1017 ___ Python tracker ___ ___

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks David. -- assignee: docs@python -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 96d728c14267 by Serhiy Storchaka in branch '3.5': Issue #29000: Fixed bytes formatting of octals with zero padding in alternate https://hg.python.org/cpython/rev/96d728c14267 New changeset 29c9c414c310 by Serhiy Storchaka in branch '3.6': Issue

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread R. David Murray
R. David Murray added the comment: OK, that makes sense. Patch looks good to me. -- ___ Python tracker ___

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch fixes this inconsistency. -- keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file45943/bytes-format-oct-alt-zero.patch ___ Python tracker

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not documentation issue, but a bug in formatting octals in bytes. >>> '%#07x' % 123 '0x0007b' >>> b'%#07x' % 123 b'0x0007b' >>> '%#07o' % 123 '0o00173' >>> b'%#07o' % 123 b'000o173' ^ -- components: +Interpreter Core -Documentation nosy:

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread woo yoo
woo yoo added the comment: Make a slight change to my code, which becomes `b'%#07x' % 34`, the weird situation appears. -- ___ Python tracker ___

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread R. David Murray
R. David Murray added the comment: The documentation matches the behavior. In this context "the first digit" is the 4. The leading zeros are the pad fill. Now, whether this is *useful* behavior or not is a separate question :) And yes, the docs could be clarified on this point either way.

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread woo yoo
woo yoo added the comment: The link is https://docs.python.org/3.5/library/stdtypes.html#printf-style-bytes-formatting -- ___ Python tracker ___

[issue29000] Not matched behavior within printf style bytes formatting

2016-12-17 Thread woo yoo
New submission from woo yoo: Per the documentation,"The alternate form causes a leading octal specifier ('0o') to be inserted before the first digit", However the actual behavior didn't conform to the principle. Code: >>>b'%#07o' % 34 Output: b'o42' -- assignee: docs@python