diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2014-01-05 06:50:30 -0800 |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2014-01-05 06:50:30 -0800 |
commit | df3ed242c07ac9d0d46faa89a4705bd6acb3dd68 (patch) | |
tree | 87d790e70c68ff68f865a37a0ecd6720580a089d /Lib/tarfile.py | |
parent | 6d2ea213372bf585e797777824c6ed2209dc22c0 (diff) | |
download | cpython-git-df3ed242c07ac9d0d46faa89a4705bd6acb3dd68.tar.gz |
Issue19995: %o, %x, %X now only accept ints
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r-- | Lib/tarfile.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index f4df6c7b0a..aec7009fed 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -196,7 +196,7 @@ def itn(n, digits=8, format=DEFAULT_FORMAT): # A 0o200 byte indicates a positive number, a 0o377 byte a negative # number. if 0 <= n < 8 ** (digits - 1): - s = bytes("%0*o" % (digits - 1, n), "ascii") + NUL + s = bytes("%0*o" % (digits - 1, int(n)), "ascii") + NUL elif format == GNU_FORMAT and -256 ** (digits - 1) <= n < 256 ** (digits - 1): if n >= 0: s = bytearray([0o200]) |