← Back to team overview

touch-packages team mailing list archive

[Bug 821000] Re: setuptools and distribute don't prepend PYTHONPATH to sys.path

 

This is a pretty old bug and setuptools has come a long way since then.
Also, distribute was re-merged back into setuptools, so it's not even a
thing any more.  I'm unassigning from myself.  I don't think this is
something that Ubuntu should drive.  Best to engage upstream setuptools,
if it's still a problem.

** Changed in: python-setuptools (Ubuntu)
     Assignee: Barry Warsaw (barry) => (unassigned)

** Changed in: distribute (Ubuntu)
       Status: Confirmed => Invalid

** Changed in: distribute
       Status: New => Invalid

** Changed in: python-setuptools (Ubuntu)
       Status: New => Opinion

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python-setuptools in
Ubuntu.
https://bugs.launchpad.net/bugs/821000

Title:
  setuptools and distribute don't prepend PYTHONPATH to sys.path

Status in tools to distribute python packages:
  Invalid
Status in python-setuptools:
  Unknown
Status in Tahoe, the Lovely Accessible File System:
  New
Status in distribute package in Ubuntu:
  Invalid
Status in python-setuptools package in Ubuntu:
  Opinion

Bug description:
  This is a long-standing issue in setuptools, which was copied into
  distribute when distribute forked. There exist patches the attempt to
  fix the issue offered against both setuptools and distribute. There
  are tickets in the setuptools issue tracker, distribute issue tracker,
  and the Tahoe-LAFS issue tracker (where we maintain a fork of
  setuptools in order to fix this among other outstanding bugs).

  The crux of the problem is that the Python documentation says:

    "The PYTHONPATH variable can be set to a list of paths that will be
  added to the beginning of sys.path."

  http://docs.python.org/install/index.html#modifying-python-s-search-
  path

  This is true with standard distutils, false with setuptools, false
  with distribute, and true if you apply the following patch to either
  setuptools or distribute:

   Index: setuptools/command/easy_install.py
   ===================================================================
   --- setuptools/command/easy_install.py  (revision 560)
   +++ setuptools/command/easy_install.py  (revision 562)
   @@ -1365,5 +1365,5 @@
                    "import sys; new=sys.path[sys.__plen:];"
                    " del sys.path[sys.__plen:];"
   -                " p=getattr(sys,'__egginsert',0); sys.path[p:p]=new;"
   +                " p=getattr(sys,'__egginsert',len(os.environ.get('PYTHONPATH','').split(os.pathsep))); sys.path[p:p]=new;"
                    " sys.__egginsert = p+len(new)\n"
                ) % data

To manage notifications about this bug go to:
https://bugs.launchpad.net/distribute/+bug/821000/+subscriptions