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.

classification
Title: 2.7 sysconfig._get_makefile_filename should be sysconfig.get_makefile_filename
Type: Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, eric.araujo, jamercee, ned.deily, python-dev
Priority: normal Keywords: patch

Created on 2014-08-14 17:28 by jamercee, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue22199_27.patch ned.deily, 2014-08-14 22:41 review
Messages (6)
msg225307 - (view) Author: Jim Carroll (jamercee) * Date: 2014-08-14 17:28
On the page https://docs.python.org/2/extending/embedding.html#compiling-and-linking-under-unix-like-systems

The documentation makes the following reference:

"...(use sysconfig.get_makefile_filename() to find its location)..."

But this is incorrect. sysconfig was modified in 3.x (Issue 9877) to use this new name. In 2.x, the function has an underscore prefix:

sysconfig._get_makefile_filename()
msg225321 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-08-14 22:41
Thanks for the report.  After reviewing the situation, I think this is actually a code bug rather than a documentation issue; in other words, things should work like the embedding documentation states.

sysconfig has a complicated history; there are currently 6 copies of sysconfig being actively maintained: Lib/sysconfig.py and Lib/distutils/sysconfig.py in each of the default (in progress 3.5), 3.4, and 2.7 branches. 5 of the 6 versions have get_makefile_filename; only the 2.7 Lib/sysconfig.py copy has _get_makefile_filename.  Some of the history details here are probably not entirely accurate but I believe the basic story is as follows.  Historically, there was only a distutils/sysconfig.py and it has had a documented get_makefile_filename() for nearly forever.  Then, during the 2.7 and 3.2 development cycles, a lot of effort went into new features for distutils, including creating Lib/sysconfig.py as a system-wide replacement for the distutils one.  As part of that feature, the get_makefile_filename function was, for some reason, deprecated and renamed to _get_makefile_filename in both the original distutils and the new Lib copies.  Later in the dev cycle, it was decided that it would be better to avoid making major changes to distutils (and the distutils2 project was started and later abandonded); as a result, the changes to distutils itself were reverted (mostly) prior to the 2.7 and 3.2 releases.  But the new Lib/sysconfig version was not modified to conform to the original (and now reverted to) name in the distutils version.  Still later, this discrepancy was noticed and Issue9877 was opened to change the name in Lib/sysconfig.py to get_makefile_file prior to its release in 3.2 but this was after Lib/sysconfig.py had already been released in 2.7 and the history of the otherwise reverted change in 2.7 may have been overlooked.  In any case, we now have this situation where Lib/sysconfig.py in 2.7 doesn't quite match any of the other versions, include its 2.7 Lib/distutils/sysconfig.py twin.

Although Lib/sysconfig.py _get_makefile_filename has never been documented, I think the safest and correct course of action is to change and document the name in 2.7 Lib/sysconfig.py but also continue to provide _get_makefile_filename as an alias.  The attached patch should do that.


https://docs.python.org/2/library/sysconfig.html
https://docs.python.org/3/library/sysconfig.html#sysconfig.get_makefile_filename
https://docs.python.org/2/distutils/apiref.html#distutils.sysconfig.get_makefile_filename
https://docs.python.org/3/distutils/apiref.html#distutils.sysconfig.get_makefile_filename
msg225708 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-22 20:49
New changeset c57cf191e759 by Ned Deily in branch '2.7':
Issue #22199: Make get_makefile_filename() available in Lib/sysconfig.py
http://hg.python.org/cpython/rev/c57cf191e759
msg225710 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-22 20:53
New changeset 404cf4c071c8 by Ned Deily in branch '2.7':
Issue #22199: update Misc/NEWS
http://hg.python.org/cpython/rev/404cf4c071c8
msg225711 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-08-22 20:55
Committed for release in 2.7.9
msg225714 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-08-22 21:26
Thanks Ned for analysing and cleanin up the mess :-)
History
Date User Action Args
2022-04-11 14:58:06adminsetgithub: 66395
2014-08-22 21:26:36eric.araujosetmessages: + msg225714
2014-08-22 20:55:31ned.deilysetstatus: open -> closed
resolution: fixed
messages: + msg225711

stage: patch review -> resolved
2014-08-22 20:53:50python-devsetmessages: + msg225710
2014-08-22 20:49:41python-devsetnosy: + python-dev
messages: + msg225708
2014-08-14 22:41:24ned.deilysetfiles: + issue22199_27.patch

assignee: docs@python ->
components: + Library (Lib), - Documentation
title: Embedding Python documentation error -> 2.7 sysconfig._get_makefile_filename should be sysconfig.get_makefile_filename
keywords: + patch
nosy: + barry, ned.deily, eric.araujo, - docs@python

messages: + msg225321
stage: patch review
2014-08-14 17:28:32jamerceecreate