code: def unicodify(filename):
      
      if isinstance(filename, bytes):
          return filename.decode(locale.getpreferredencoding())
      else:
          return filename
docs: Make sure filename is Unicode.
  
      Because the tarfile module on Python 2 doesn't return Unicode.