[New-bugs-announce] [issue29934] % formatting fails to find formatting code in bytes type after a null byte
Mert Bora Alper
report at bugs.python.org
Tue Mar 28 10:37:41 EDT 2017
New submission from Mert Bora Alper:
Hello,
In Python 3.6.0, % formatting fails to find formatting code after a null byte in bytes type.
Example:
>>> "%s_\x00%s" % ("hello", "world")
'hello_\x00world'
>>> b"%s_\x00%s" % (b"hello", b"world")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: not all arguments converted during bytes formatting
In contrast, the exact same code works as expected in Python 3.5:
>>> "%s_\x00%s" % ("hello", "world")
'hello_\x00world'
>>> b"%s_\x00%s" % (b"hello", b"world")
b'hello_\x00world'
I used Python 3.6.0 that I installed using pyenv 1.0.8 on Kubuntu 16.04 x86_64.
----------
messages: 290724
nosy: boramalper
priority: normal
severity: normal
status: open
title: % formatting fails to find formatting code in bytes type after a null byte
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29934>
_______________________________________
More information about the New-bugs-announce
mailing list