summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
commitef87d6ed94780fe00250a551031023aeb2898365 (patch)
tree1f8989aaaec7ec5f8b2f26498317f2022bf85531 /Lib/tarfile.py
parent572dbf8f1320c0b34b9c786e5c30ba4a4b61b292 (diff)
downloadcpython-ef87d6ed94780fe00250a551031023aeb2898365.zip
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.gz
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.bz2
Rip out all the u"..." literals and calls to unicode().
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index efade27..3eb7704 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1031,7 +1031,7 @@ class TarInfo(object):
for name, digits in (("uid", 8), ("gid", 8), ("size", 12), ("mtime", 12)):
val = info[name]
if not 0 <= val < 8 ** (digits - 1) or isinstance(val, float):
- pax_headers[name] = unicode(val)
+ pax_headers[name] = str(val)
info[name] = 0
if pax_headers:
@@ -1054,12 +1054,12 @@ class TarInfo(object):
@staticmethod
def _to_unicode(value, encoding):
- if isinstance(value, unicode):
+ if isinstance(value, str):
return value
elif isinstance(value, (int, float)):
- return unicode(value)
+ return str(value)
elif isinstance(value, str):
- return unicode(value, encoding)
+ return str(value, encoding)
else:
raise ValueError("unable to convert to unicode: %r" % value)