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 jaraco
Recipients eric.araujo, jaraco, tarek
Date 2013-10-18.19:10:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382123460.13.0.176528626985.issue19286@psf.upfronthosting.co.za>
In-reply-to
Content
On Python 2.7 and 3.3, if the package_data glob happens to match a directory, it will trigger this error during build:

error: can't copy '<package>/<dirname>': doesn't exist or not a regular file

It seems that package_data is not very smart about filtering out directories, and assumes every name matched in the glob is a file. This is particularly inconvenient when one has a directory structure of package data. Consider:

	package_data={
		'bug_pkg': (
			[
				'html/*.*',
				'html/something-1.0/*.*',
			]
		),
	},

with a directory structure of:

.
│   setup.py
│
└───bug_pkg
    │   __init__.py
    │
    └───html
        │   index.html
        │
        └───something-1.0
                index.dat

Since 'html/*.*' matches 'something-1.0', distutils assumes something-1.0 is a file and tries to copy it and fails with:

error: can't copy 'bug_pkg/html/something-1.0': doesn't exist or not a regular file

I believe distutils should be filtering out folders from package_data. In the past, users (including myself) have worked around the issue by using '*.*' to match only files, but that's a poor heuristic is the above example demonstrates.

This issue was encountered when using sphinx-bootstrap-theme, which adds directories to sphinx HTML docs with directories like 'bootstrap-3.0.0', which are difficult to not match in a glob.

Is there any reason why globs specified in package_data should not exclude all directories?
History
Date User Action Args
2013-10-18 19:11:00jaracosetrecipients: + jaraco, tarek, eric.araujo
2013-10-18 19:11:00jaracosetmessageid: <1382123460.13.0.176528626985.issue19286@psf.upfronthosting.co.za>
2013-10-18 19:11:00jaracolinkissue19286 messages
2013-10-18 19:10:59jaracocreate