[issue29714] can't interpolate byte string with \x00 before replacement identifier

Nick Huber report at bugs.python.org
Fri Mar 3 14:05:28 EST 2017


New submission from Nick Huber:

Python 3.6.0 (default, Mar  3 2017, 00:15:36) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> b'a\x00%i' % 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not all arguments converted during bytes formatting
>>> b'a%i' % 1
b'a1'
>>> b'a%i\x00' % 1
b'a1\x00'


On python3.5, this works in all the scenarios

Python 3.5.1 (default, Jan 14 2017, 03:58:20) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> b'a\x00%i' % 1
b'a\x001'
>>> b'a%i' % 1
b'a1'
>>> b'a%i\x00' % 1
b'a1\x00'

----------
components: Interpreter Core
messages: 288912
nosy: Nick Huber
priority: normal
severity: normal
status: open
title: can't interpolate byte string with \x00 before replacement identifier
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29714>
_______________________________________


More information about the Python-bugs-list mailing list