Issue 29934: % formatting fails to find formatting code in bytes type after a null byte (original) (raw)

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 "", line 1, in 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.