Repository navigation
Closed
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2019-02-02.10:16:29.281>
created_at = <Date 2015-11-10.06:06:12.564>
labels = ['3.7', '3.8', 'type-bug', 'library', 'docs']
title = 'distutils docs: data_files always uses sys.prefix'
updated_at = <Date 2019-02-02.10:17:12.823>
user = 'https://github.com/jdemeyer'bugs.python.org fields:
activity = <Date 2019-02-02.10:17:12.823>
actor = 'pitrou'
assignee = 'docs@python'
closed = True
closed_date = <Date 2019-02-02.10:16:29.281>
closer = 'pitrou'
components = ['Distutils', 'Documentation']
creation = <Date 2015-11-10.06:06:12.564>
creator = 'jdemeyer'
dependencies = []
files = []
hgrepos = []
issue_num = 25592
keywords = ['patch']
message_count = 21.0
messages = ['254432', '327403', '327407', '327408', '327412', '327413', '327415', '327416', '327455', '334492', '334511', '334565', '334566', '334567', '334568', '334607', '334619', '334698', '334700', '334740', '334741']
nosy_count = 6.0
nosy_names = ['pitrou', 'eric.araujo', 'docs@python', 'berker.peksag', 'jdemeyer', 'dstufft']
pr_nums = ['9767', '11701', '11701', '11701', '11734', '11734', '11734']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue25592'
versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']
Activity
jdemeyer commentedon Nov 10, 2015
The documentation for distutils claims that sys.exec_prefix is used in certain cases to install data_files, but this is simply not true (maybe it was true in the past or this sentence was copy/pasted from somewhere else?)
merwok commentedon Oct 9, 2018
If you’re not sure about the reason for that sentence, I think you should not remove it from the docs but investigate more (look at the history, test the conditions (package with extension module), etc).
jdemeyer commentedon Oct 9, 2018
If the docs are wrong, their history doesn't matter that much: the docs should be fixed regardless.
I did that before posting this bug report. I also looked at the distutils sources. I couldn't find any evidence that data_files are ever installed in sys.exec_prefix.
jdemeyer commentedon Oct 9, 2018
Just for fun, let's look at the history. That piece of documentation goes back to
commit 632bda3
Author: Fred Drake <fdrake@acm.org>
Date: Fri Mar 8 22:02:06 2002 +0000
I haven't tried to compile that Python version from 2002 but the distutils sources from that time look quite close to what they are today (scary, no?). So my gut feeling is that those docs were wrong even at the time that they were written.
jdemeyer commentedon Oct 9, 2018
There is also
commit fa2f4b6
Author: Greg Ward <gward@python.net>
Date: Sat Jun 24 17:22:39 2000 +0000
with commit message stating that data_files are installed in sys.prefix.
merwok commentedon Oct 9, 2018
What I was saying is that I am not sure that the docs are wrong.
Distutils is more touchy that the rest of the stdlib and I err on the side of caution.
jdemeyer commentedon Oct 9, 2018
Well, I did try it on a minimal Python project. I also read the distutils sources and understood why it installs data_files in sys.prefix by default. So what more do you need to be convinced?
merwok commentedon Oct 9, 2018
Did you try with a minimal project containing a C extension?
Did you install in a system where sys.prefix != sys.exec_prefix?
jdemeyer commentedon Oct 10, 2018
Yes to both questions.
1 remaining item
jdemeyer commentedon Jan 29, 2019
So would you be willing to merge the PR then?
pitrou commentedon Jan 30, 2019
New changeset 598e15d by Antoine Pitrou (jdemeyer) in branch 'master':
bpo-25592: Improve documentation of distutils data_files (GH-9767)
598e15d
merwok commentedon Jan 30, 2019
Thanks for the analysis and PR! Sorry that the slow process here was frustrating.
pitrou commentedon Jan 30, 2019
New changeset ebae1ce by Antoine Pitrou (Miss Islington (bot)) in branch '3.7':
bpo-25592: Improve documentation of distutils data_files (GH-9767) (GH-11701)
ebae1ce
pitrou commentedon Jan 30, 2019
Fixing this on 2.7 would require additional investigation (distutils might have diverged), so I'm closing now.
jdemeyer commentedon Jan 31, 2019
Let's be honest, we are talking about distutils here. So it's way more likely that it didn't diverge and that the behavior is exactly the same on 2.7 and 3.8. So I would suggest to backport it to 2.7 also.
pitrou commentedon Jan 31, 2019
Jeroen you're right. Could you still give it a quick check? Then I'll mark the PR for a 2.7 backport.
jdemeyer commentedon Feb 1, 2019
I did just that. For reference, these are the steps:
jdemeyer commentedon Feb 1, 2019
(note typo in the above: /tmp/prefix/pip should be /tmp/prefix/bin/pip)
pitrou commentedon Feb 2, 2019
New changeset 40a101d by Antoine Pitrou (Miss Islington (bot)) in branch '2.7':
bpo-25592: Improve documentation of distutils data_files (GH-9767) (GH-11734)
40a101d
pitrou commentedon Feb 2, 2019
Ok, this is now pushed to 2.7 as well. Thank you Jeroen!