This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Patrik Dufresne
Recipients Patrik Dufresne, ezio.melotti, vstinner
Date 2016-01-02.19:53:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451764405.28.0.333419880033.issue25997@psf.upfronthosting.co.za>
In-reply-to
Content
With python 3.4, Tarfile doesn't properly support adding a files with bytes path. Only unicode is supported. It's failing with exception similar to:

    tar.add(os.path.join(dirpath, filename), filename)
  File "/usr/lib/python3.4/tarfile.py", line 1907, in add
    tarinfo = self.gettarinfo(name, arcname)
  File "/usr/lib/python3.4/tarfile.py", line 1767, in gettarinfo
    arcname = arcname.replace(os.sep, "/")
TypeError: expected bytes, bytearray or buffer compatible object

It uses os.sep, and u"/". Instead, it should use something like posixpath.py:_get_sep(path).
History
Date User Action Args
2016-01-02 19:53:25Patrik Dufresnesetrecipients: + Patrik Dufresne, vstinner, ezio.melotti
2016-01-02 19:53:25Patrik Dufresnesetmessageid: <1451764405.28.0.333419880033.issue25997@psf.upfronthosting.co.za>
2016-01-02 19:53:25Patrik Dufresnelinkissue25997 messages
2016-01-02 19:53:24Patrik Dufresnecreate