Title: Don’t fail silently if ext_modules use absolute paths
Type: behavior Stage: needs patch
Components: Distutils Versions: Python 3.4, Python 3.5, Python 2.7
Status: open Resolution:
Dependencies: 5977 Superseder:
Assigned To: eric.araujo Nosy List: dstufft, eric.araujo, indiedan, tarek, vstinner
Priority: normal Keywords: patch

Created on 2010-07-21 14:05 by indiedan, last changed 2019-07-29 11:28 by vstinner.

File name Uploaded Description Edit
d1-ext-absolute-sources-9322.diff eric.araujo, 2011-09-12 16:24 review
Messages (5)
msg111058 - (view) Author: Dan OD (indiedan) Date: 2010-07-21 14:05
Setting absolute paths for C source code files in breaks bdist_rpm

ext_modules=[Extension('foo', [os.path.abspath('src/foo.c')])],

results in bdist_rpm not including src/foo.c in the RPM, however

ext_modules=[Extension('foo', ['src/foo.c'])],

works just fine.
msg111062 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-07-21 14:23
Examples in the documentation only use relative paths, so in my opinion the bug here is the silent failure.

Do absolute paths work for sdist or other bdists?
msg111065 - (view) Author: Dan OD (indiedan) Date: 2010-07-21 14:28
I'm still ironing out the crinkles, but this has been working for

build (/install)

unfortunately I don't have access to a Windows machine to test the other two. A non-silent warning/error would keep me happy.
msg143919 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-12 16:24
I started to work on a simple patch but it makes one of our tests fail.  It uses absolute paths because it needs to change directory and check that get_outputs works.
msg348611 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-29 11:28
This issue is 9 years old has a patch: it's far from being "newcomer friendly", I remove the "Easy" label.
Date User Action Args
2019-07-29 11:28:33vstinnersetkeywords: - easy
nosy: + vstinner
messages: + msg348611

2014-06-28 14:18:22BreamoreBoysetnosy: + dstufft

components: - Distutils2
versions: + Python 3.4, Python 3.5, - 3rd party, Python 3.2, Python 3.3
2011-09-12 16:24:19eric.araujosetfiles: + d1-ext-absolute-sources-9322.diff
versions: + Python 3.3, - Python 3.1
messages: + msg143919

dependencies: + distutils build_ext.get_outputs returns wrong result
keywords: + patch
2010-12-15 23:12:00eric.araujosetkeywords: + easy
nosy: tarek, eric.araujo, indiedan
2010-11-12 00:51:11eric.araujosettitle: bdist_rpm ext_modules absolute source path fail -> Don’t fail silently if ext_modules use absolute paths
nosy: tarek, eric.araujo, indiedan
versions: + 3rd party, Python 3.1, Python 3.2
assignee: tarek -> eric.araujo
components: + Distutils2
stage: needs patch
2010-07-21 14:28:11indiedansetmessages: + msg111065
2010-07-21 14:23:36eric.araujosetnosy: + eric.araujo
messages: + msg111062
2010-07-21 14:05:28indiedancreate