Brought to you by the PyCon core sprint, I rewrote Lib/site.py to clean it up and modernize it. The biggest change is putting all the code into appropriate functions and defining a main() function that gets executed at import. Cleans up the code and allows others to run the functions after import in case they want the functionality. Also modernized it by using sets and universal newlines. A new test suite is also being included in this tracker item. You can partially run it against the original site.py, but some tests will fail since they call new functions.
Logged In: YES user_id=357491 Just discovered one of the regression tests fails if you run all the tests with regrtest.py. Trying to fix now since it is a bug in the test.
Logged In: YES user_id=357491 OK, now the test passes. Problem test was not matching what the code did by creating a normalized, absolute path of what was in sys.path .
Logged In: YES user_id=357491 Thanks to Raymond, I have worked out a single bug in my code (left out an import that only shows up under Windows) and fixed some bad tests. Unless someone finds some bugs in this in a week or so I will check this in.
Logged In: YES user_id=357491 Got impatient. =) Checked in both the changes to site.py and the addition of test_site.py (SF is not responding to ``cvs log`` to get the version numbers for the check-in).