Attached is a patch I used as a work-around for the issue. It ensures the following test pass:
def test_subtargs(): assert _subst_tuple_args( b'A%s, %sB', (b'1',b'2') ) == b'A1, 2B' assert _subst_tuple_args( b'A%s, %sB', (b'%s1',b'2') ) == b'A%s1, 2B' assert _subst_tuple_args( b"A%s, 'B%C'", (b'%s1',) ) == b"A%s1, 'B%C'" assert _subst_tuple_args( b"AB", () ) == b"AB" try: assert _subst_tuple_args( b"AB", (1,) ) == '', 'Too many arg exception expected' except ValueError: pass try: assert _subst_tuple_args( b'A%s, %sB', (b'1',) ) == '', 'Missing arg exception expected' except IndexError: pass
Attached is a patch I used as a work-around for the issue. It ensures the following test pass:
def test_subtargs():
assert _subst_tuple_args( b'A%s, %sB', (b'1',b'2') ) == b'A1, 2B'
assert _subst_tuple_args( b'A%s, %sB', (b'%s1',b'2') ) == b'A%s1, 2B'
assert _subst_tuple_args( b"A%s, 'B%C'", (b'%s1',) ) == b"A%s1, 'B%C'"
assert _subst_tuple_args( b"AB", () ) == b"AB"
try:
assert _subst_tuple_args( b"AB", (1,) ) == '', 'Too many arg exception expected'
except ValueError:
pass
try:
assert _subst_tuple_args( b'A%s, %sB', (b'1',) ) == '', 'Missing arg exception expected'
except IndexError:
pass