[Python-bugs-list] [ python-Bugs-442983 ] site.py rev 1.28 broke addsitedir()

noreply@sourceforge.net noreply@sourceforge.net
Thu, 19 Jul 2001 23:33:57 -0700


Bugs item #442983, was opened at 2001-07-19 23:33
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442983&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: site.py rev 1.28 broke addsitedir()

Initial Comment:
addsitedir() was changed to refer to global
dirs_in_sys_path, but that global got explictly del'ed 
on line 152 too, so it doesn't exist when addsitedir() 
is called.  Report from c.l.py follows:

"""
From: David Konerding <dek@cgl.ucsf.edu>
Sent: Friday, July 20, 2001 1:56 AM
To: python-list@python.org
Subject: python 2.1.1 trouble with addsitedir


Hi, I am checking my application's compatibility wiht 
2.1.1 and I've
run into a snag.  We use "site.addsitedir" to add a 
directory to the
loading path.

As an example, the following works just fine on Python-
2.1:

[dek@tolkien dek]$ python
Python 2.1 (#2, Jul 19 2001, 20:48:59) 
[GCC 2.95.3 20010315 (release)] on linux2
Type "copyright", "credits" or "license" for more 
information.
>>> import site
>>> site.addsitedir("/tmp")
>>> 


but running it with 2.1.1 gives the following:

[dek@tolkien Python-2.1.1c1]
$ /var/tmp/python/bin/python
Python 2.1.1c1 (#1, Jul 19 2001, 22:49:25) 
[GCC 2.95.3 20010315 (release)] on linux2
Type "copyright", "credits" or "license" for more 
information.
>>> import site
>>> site.addsitedir("/tmp")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/var/tmp/python/lib/python2.1/site.py", line 
100, in addsitedir
    if not dirs_in_sys_path.has_key(sitedircase):
NameError: global name 'dirs_in_sys_path' is not 
defined
"""


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=442983&group_id=5470