This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: format string '%b' doesn't work as expected
Type: behavior Stage:
Components: None Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: James.Classen
Priority: normal Keywords:

Created on 2011-12-14 20:18 by James.Classen, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg149471 - (view) Author: James Classen (James.Classen) Date: 2011-12-14 20:18
I notice that, in versions 2.7 and 3.2 on Windows XP (haven't tested any other versions or platforms), the following statements in the interpreter work as documented:

'%x' % 17
'%o' % 17

and output '11' and '21' respectively, as I expect. However,

'%b' % 17

throws "ValueError: unsupported format character 'b' (0x62) at index 1" instead of returning '10001'.
msg149472 - (view) Author: James Classen (James.Classen) Date: 2011-12-14 20:30
I didn't see section 4.6.2 of the library for 3.2 documentation, only section 5.6.2 of the 2.7 docs. So this is an invalid issue.
History
Date User Action Args
2022-04-11 14:57:24adminsetgithub: 57811
2011-12-14 20:30:44James.Classensetstatus: open -> closed
resolution: not a bug
messages: + msg149472
2011-12-14 20:18:40James.Classencreate