]> granicus.if.org Git - python/commit
Convert all entries on sys.path to absolute paths, and also update the
authorFred Drake <fdrake@acm.org>
Thu, 28 Sep 2000 16:52:36 +0000 (16:52 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 28 Sep 2000 16:52:36 +0000 (16:52 +0000)
commit38cb9f1f174415d3b37fbaeb5d152d65525839d2
treee4dab6e52b796e35df535cb1f99718e4a119d5b2
parentb4e460ac4b5a5b7e72b0eb6e8d21af179464c3d7
Convert all entries on sys.path to absolute paths, and also update the
__file__ attributes of already-imported modules to be absolute.  This helps
robustify the interpreter against os.chdir() calls from the application.

Only remove setdefaultencoding() from sys if it exists; if this module is
run as a script (since there is a _test() function that gets run), it broke
because the script attempts to remove it again after the import of site
has already done so.  This allows the module to be run as a script again.

makepath():  New function, standardizes all pathname normalization in one
             place.
Lib/site.py