mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Rip out all the u"..." literals and calls to unicode().
This commit is contained in:
parent
572dbf8f13
commit
ef87d6ed94
200 changed files with 18074 additions and 18074 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue