Bug 1851090

Summary: distutils module: sysconfig.get_config_var('LIBPL') returns non existing directory
Product: Red Hat Enterprise Linux 8 Reporter: Victor Stinner <vstinner>
Component: python3Assignee: Python Maintainers <python-maint>
Status: CLOSED ERRATA QA Contact: Lukáš Zachar <lzachar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: cstratak, dmalcolm, extras-qa, m.cyprian, mhroncok, pviktori, rkuska, shcherbina.iryna, slavek.kabrda, tomspur, torsava, vstinner, zdohnal
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: python3-3.6.8-30.el8 Doc Type: Bug Fix
Doc Text:
The python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))" command returns the /usr/lib64/python3.6/config-m-x86_64-linux-gnu path which doesn't exist. With the fix, the command returns the correct path: /usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu ("config-3.6m" instead of "config-m").
Story Points: ---
Clone Of: 1851008 Environment:
Last Closed: 2020-11-04 01:30:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1851008    
Bug Blocks:    

Description Victor Stinner 2020-06-25 15:17:28 UTC
+++ This bug was initially created as a clone of Bug #1851008 +++

Description of problem:
python3-3.7.7-3 introduces a regression in distutils module:

$ python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"


$ python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"


The regression causes Vim to fail to build in F31 branch.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
See above

Actual results:
prints an incorrect path

Expected results:
prints a correct path

Additional info:

--- Additional comment from Miro Hrončok on 2020-06-25 12:31:52 UTC ---

Thanks for the report. Victor, can you please have a look?

$ python3.6 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"

$ python3.7 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"

$ python3.8 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"

--- Additional comment from Victor Stinner on 2020-06-25 14:51:51 UTC ---

Oh no! I broke sysconfig LIBPL variable when fixing "python3-config --configdir" in bz#1772988 :-(

bz#1772988 fixed a first downstream bug, and this issue is about a second downstream bug: the 00178-dont-duplicate-flags-in-sysconfig.patch downstream patch is wrong and should be removed. It causes this bug.

If I revert it, distutils.sysconfig.get_config_var('LIBPL') returns /usr/lib64/python3.7/config-3.7m-x86_64-linux-gnu as expected.

--- Additional comment from Victor Stinner on 2020-06-25 15:02:15 UTC ---

This issue is basically the same than https://bugzilla.redhat.com/show_bug.cgi?id=1710767 which was fixed by removing 00178-dont-duplicate-flags-in-sysconfig.patch in the Python 3.8 package.

I proposed https://src.fedoraproject.org/rpms/python3.7/pull-request/4 to remove the patch.

--- Additional comment from Victor Stinner on 2020-06-25 15:15:42 UTC ---

And https://src.fedoraproject.org/rpms/python3.6/pull-request/4 for Python 3.6.

Comment 1 Victor Stinner 2020-06-25 15:20:52 UTC
In RHEL8, python3 3.6.8-29 has the issue (rhbz#1772992). But it's not really a regression, the bug was already present before the rhbz#1772992 fix. It's just that LIBPL didn't expose the bug previously.

Comment 3 Zdenek Dohnal 2020-06-26 04:25:23 UTC
Hi Victor,

just my 2 cents - I cannot reproduce the bug on RHEL 8.

[root@ci-vm-10-0-138-171 ~]# python3 -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"

Unless you have somewhere new python update waiting, RHEL 8 hasn't been affected yet.

Comment 4 Victor Stinner 2020-06-26 11:56:39 UTC
> just my 2 cents - I cannot reproduce the bug on RHEL 8.

The issue is in python3 3.6.8-29 (rhbz#1772992) which is not in repositories yet (it's at the ON_QA stage).

Comment 11 errata-xmlrpc 2020-11-04 01:30:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: python3 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.