Python sysconfig._get_makefile_filename() fails inside a virtualenv

Bug #1204541 reported by hollaburoo
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-defaults (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When Python is running inside a virtualenv located in /usr/local/app/env/ sysconfig._get_makefile_filename() fails on the first call.

It incorrectly strips "/local" from the path name, trying to read it's makefile from /usr/app/

The line in question appears to be:

return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")

I am running on Ubuntu 12.04 LTS with python version 2.7.3-0ubuntu3.2

Revision history for this message
Christian Schneider (schneider-3) wrote :

Hi,

I'm having the same problem. I have, however, another server with the same python and ubuntu versions where I can easily install virtualenvs under /usr/local; the difference is the version of virtualenv 1.7.1.2 (good) vs. 1.10 (bad). So it seems to be an issue with virtualenv.

chris

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-defaults (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Schneider (schneider-3) wrote :

Did some further digging.

The actual "culprit" is the file pep425tags.py which belongs to pip. In this file there is a function "get_supported" which contains the following line "oabi = sysconfig.get_config_var('SOABI')". This in turn ends up calling "_get_makefile_filename()".

I don't have the slightest idea where this should be resolved …

chris

Revision history for this message
hollaburoo (hollaburoo) wrote :

Anything that calls _get_makefile_filename() fails.

If you import sysconfig and run sysconfig.get_config_vars() it will fail.

Revision history for this message
Diep Pham (favadi) wrote :

Noboy is working on this bug? Is there any workaround for it?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.