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 2011-12-14 20:30 by James.Classen. 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
2011-12-14 20:30:44James.Classensetstatus: open -> closed
resolution: not a bug
messages: + msg149472
2011-12-14 20:18:40James.Classencreate