Opened 10 years ago

Closed 5 years ago

#71 closed defect (fixed)

python: X:/USR is returned instead of /@unixroot/usr

Reported by: Yuri Dario Owned by:
Priority: Feedback Pending Milestone:
Component: python Version:
Severity: highest Keywords:
Cc:

Description

With support for virtual env, now python returns /USR for system path. This breaks installation scripts, because files are not remapped to correct %UNIXROOT% drive but written to default drive.

dmik:

  1. Fix setup.py machinery so that it leaves the drive letter in, i.e. in your example it should give this:

X:/USR/lib/python2.7/site-packages/urlgrabber/byterange.py

  1. Fix setup.py machinery so that it replaces X:/USR back with /@unixroot/usr
  1. Fix dynamic python sys.path detection so that it replaces X:/USR with /@unixroot/usr when it’s run from X:/USR/bin.

I think 3 is the most long term effective solution as it requires less modifications in 3rd party software. If we agree on that I may look back into the place where I fixed it (to make sys.path dynamic and hence fix virtualenv and some other things).

I want to remind that the source of this problem is that /@unixroot is not a real dir on OS/2 but something like a symlink (from the LIBC point of view).

Change History (6)

comment:1 Changed 10 years ago by dmik

Summary: python: /USR is returned instead of /@unixrootpython: X:/USR is returned instead of /@unixroot/usr

comment:2 Changed 10 years ago by dmik

Something's wrong with permissions here: I could successfully change the title of the ticket but I can't change the description. It should read that python returns X:/USR now instead of /@unixroot/usr at some places. To be exact, at all places that derive from the location of the python executable (before all these places derived from a hardcoded value /@unixroot/usr/blah).

The change set where hardcoding was removed is r383. The responsible function is calculate_path() in getpath.c.

Note that Yuri has temporarily worked around the issue by replacing /USR with /@unixroot/usr in install scripts in a number of packages:

libxml2-python.spec
mercurial.spec
s3cmd.spec
setuptools.spec
urlgrabber.spec

But this is hackish and not scalable (requires manual fix for each affected package which will break if you ever change the installation path). These workarounds need to be undone once this issue is fixed and tested.

comment:3 Changed 10 years ago by Silvan Scherrer

@dmik you should now have the rights to change descriptions.

comment:4 Changed 8 years ago by Yuri Dario

Severity: highest

The same problem is now with yum-utils, I'm going to hardcode unixroot until we fix this ticket.

http://trac.netlabs.org/ports/changeset/1598

Last edited 8 years ago by Yuri Dario (previous) (diff)

comment:5 Changed 6 years ago by Silvan Scherrer

Priority: majorFeedback Pending

didn't we fix that in one of the latest python?

comment:6 Changed 5 years ago by Silvan Scherrer

Resolution: fixed
Status: newclosed

as

python -c 'import sys; print sys.prefix'

brings back /@unixroot/usr I'm pretty sure this is fixed.
I close it. If it's still an issue please reopen.

Note: See TracTickets for help on using tickets.