summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2014-01-05 06:50:30 -0800
committerEthan Furman <ethan@stoneleaf.us>2014-01-05 06:50:30 -0800
commitdf3ed242c07ac9d0d46faa89a4705bd6acb3dd68 (patch)
tree87d790e70c68ff68f865a37a0ecd6720580a089d /Lib/tarfile.py
parent6d2ea213372bf585e797777824c6ed2209dc22c0 (diff)
downloadcpython-git-df3ed242c07ac9d0d46faa89a4705bd6acb3dd68.tar.gz
Issue19995: %o, %x, %X now only accept ints
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py2
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])