[Patches] [Patch #101973] test_import.py fails on Unix when run any but the local dir

noreply@sourceforge.net noreply@sourceforge.net
Wed, 18 Oct 2000 23:10:23 -0700


Patch #101973 has been updated. 

Project: 
Category: library
Status: Open
Summary: test_import.py fails on Unix when run any but the local dir

Follow-Ups:

Date: 2000-Oct-18 16:40
By: tmick

Comment:
Make test_import.py pass when it is invoked as follows:
  > ./python Lib/test/test_import.py
or
  > ./python Lib/test/regrtest.py test_import
I.e. from any dir other that where test_import.py exists.

The problem was that on Unix, if a relative path to a script is given on the command line, that path is added to sys.path and *not* the current directory. That is fine, except that test_import.py presumed that the current directory (in which @TESTFN.py is created) is on sys.path.

Solution:
  Put the current working dir on sys.path.

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

Date: 2000-Oct-18 16:41
By: tmick

Comment:
TIm's checkin said that this was your module Jeremy so I am assigning to you for review.
-------------------------------------------------------

Date: 2000-Oct-18 23:10
By: tmick

Comment:
a comment from Neil:

I disagree.  The test suite should not assume write access to the
current directory.  It should probably create a temparary
directory using mktemp() or similar, add that to sys.path and
create files there.

Sorry about not using SF but I'm on a 14.4k modem. :(

  Neil


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

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=101973&group_id=5470