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 ghazel
Recipients ghazel, tarek
Date 2010-06-18.08:47:27
SpamBayes Score 1.5088517e-07
Marked as misclassified No
Message-id <>
Probably applies to more versions, but I only tested on 2.5.2 and 2.6.5.

Distutils incorrectly constructs paths for the build/temp directory when relative paths are used in the "sources" list. This can result in failing to make the build/temp directory at all, and placing files in outside of the build/temp directory.

Consider the following example:

gah@duma:~$ mkdir libfoo
gah@duma:~$ cd libfoo
gah@duma:~/libfoo$ echo > foo.c
gah@duma:~/libfoo$ mkdir pyfoo
gah@duma:~/libfoo$ cd pyfoo
gah@duma:~/libfoo/pyfoo$ echo "from setuptools import setup, Library; setup(name='foo', ext_modules=[Library(name='foo',sources=['../foo.c'])])" >
gah@duma:~/libfoo/pyfoo$ python build
running build
running build_ext
building 'foo' extension
creating build
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c ../foo.c -o build/temp.linux-i686-2.5/../foo.o
Assembler messages:
Fatal error: can't create build/temp.linux-i686-2.5/../foo.o: No such file or directory
error: command 'gcc' failed with exit status 1

Using os.path.abspath('../foo.c') in the sources causes distutils to create build/temp.linux-i686-2.5/home/gah/libfoo/foo.o which is fine. However as a user, this situation is quite surprising, since distutils is responsible for managing the build and temp directories itself.
Date User Action Args
2010-06-18 08:47:31ghazelsetrecipients: + ghazel, tarek
2010-06-18 08:47:31ghazelsetmessageid: <>
2010-06-18 08:47:29ghazellinkissue9023 messages
2010-06-18 08:47:27ghazelcreate