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 martin.panter
Recipients martin.panter
Date 2014-04-17.08:09:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397722199.92.0.999945404475.issue21280@psf.upfronthosting.co.za>
In-reply-to
Content
>>> from shutil import make_archive; make_archive("a", "tar")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/shutil.py", line 783, in make_archive
    filename = func(base_name, base_dir, **kwargs)
  File "/usr/lib/python3.4/shutil.py", line 605, in _make_tarball
    os.makedirs(archive_dir)
  File "/usr/lib/python3.4/os.py", line 244, in makedirs
    mkdir(name, mode)
FileNotFoundError: [Errno 2] No such file or directory: ''

Looking at the code, it calls os.path.dirname("a.tar") -> "", which would be the cause of this bug.

The workaround for me was adding an explicit make_archive(root_dir=".") parameter.

I was also surprised to see the code calling os.makedirs(archive_dir). Usually if you try to make a file in a non-existent directory, it fails, rather than automatically creating the directory for you. But maybe that’s just a general spirit of the “shutil” module that I didn’t pick up on.
History
Date User Action Args
2014-04-17 08:09:59martin.pantersetrecipients: + martin.panter
2014-04-17 08:09:59martin.pantersetmessageid: <1397722199.92.0.999945404475.issue21280@psf.upfronthosting.co.za>
2014-04-17 08:09:59martin.panterlinkissue21280 messages
2014-04-17 08:09:59martin.pantercreate