[issue28553] int.to_bytes docs logic error

2016-10-31 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue28553] int.to_bytes docs logic error

2016-10-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 32d8c89e90d1 by INADA Naoki in branch '3.5': Issue #28553: Fix logic error in example code of int.to_bytes doc. https://hg.python.org/cpython/rev/32d8c89e90d1 New changeset 2ae3f1599c34 by INADA Naoki in branch '3.6': Issue #28553: Fix logic error

[issue28553] int.to_bytes docs logic error

2016-10-31 Thread Mark Dickinson
Mark Dickinson added the comment: Patch LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28553] int.to_bytes docs logic error

2016-10-30 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +mark.dickinson ___ Python tracker ___

[issue28553] int.to_bytes docs logic error

2016-10-30 Thread INADA Naoki
INADA Naoki added the comment: Make sense. -- keywords: +easy, patch nosy: +inada.naoki stage: -> commit review versions: -Python 3.3, Python 3.4 Added file: http://bugs.python.org/file45280/28553.patch ___ Python tracker

[issue28553] int.to_bytes docs logic error

2016-10-28 Thread Ofek Lev
New submission from Ofek Lev: https://docs.python.org/3/library/stdtypes.html#int.to_bytes To convert an int to the exact number of bytes required, the docs recommend "x.to_bytes((x.bit_length() // 8) + 1, ...)". This is incorrect when length is a multiple of 8, e.g. 296. The correct way is