diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-11-02 13:04:51 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-11-02 13:04:51 -0400 |
commit | e71fb28519185cecbec08e0b00f3717b16b072fd (patch) | |
tree | e714ece53560b21b885a69d54cae2b084926f4ce /Lib/distutils/tests/test_build_py.py | |
parent | 32dfef81a2c99d755c485ea5399d28b52d37a9e0 (diff) | |
parent | ca9242f4f9c5bd496b578a4a2b2ed5fa91d94095 (diff) | |
download | cpython-e71fb28519185cecbec08e0b00f3717b16b072fd.tar.gz cpython-e71fb28519185cecbec08e0b00f3717b16b072fd.zip |
Merge with 3.3 for Issue #19286.
Diffstat (limited to 'Lib/distutils/tests/test_build_py.py')
-rw-r--r-- | Lib/distutils/tests/test_build_py.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py index 1b410c397d8..c8f6b899199 100644 --- a/Lib/distutils/tests/test_build_py.py +++ b/Lib/distutils/tests/test_build_py.py @@ -123,6 +123,37 @@ class BuildPyTestCase(support.TempdirManager, self.assertEqual(sorted(found), ['boiledeggs.%s.pyo' % sys.implementation.cache_tag]) + def test_dir_in_package_data(self): + """ + A directory in package_data should not be added to the filelist. + """ + # See bug 19286 + sources = self.mkdtemp() + pkg_dir = os.path.join(sources, "pkg") + + os.mkdir(pkg_dir) + open(os.path.join(pkg_dir, "__init__.py"), "w").close() + + docdir = os.path.join(pkg_dir, "doc") + os.mkdir(docdir) + open(os.path.join(docdir, "testfile"), "w").close() + + # create the directory that could be incorrectly detected as a file + os.mkdir(os.path.join(docdir, 'otherdir')) + + os.chdir(sources) + dist = Distribution({"packages": ["pkg"], + "package_data": {"pkg": ["doc/*"]}}) + # script_name need not exist, it just need to be initialized + dist.script_name = os.path.join(sources, "setup.py") + dist.script_args = ["build"] + dist.parse_command_line() + + try: + dist.run_commands() + except DistutilsFileError: + self.fail("failed package_data when data dir includes a dir") + def test_dont_write_bytecode(self): # makes sure byte_compile is not used dist = self.create_dist()[1] |