Ah, os.path has a method for the job. I should have checked the module before reinventing the wheel ... For some unknown and mysterious reasons the inspect tests are passing again on my machine. I've purged the pyc files before I run the unpatched test suite. Should I apply the patch anyway?
Yes, the patch is needed. The problem arises when you run the python executable in different ways WITHOUT deleting the .pyc files. Example on my machine: Note that the exact path to run python is not the same: >cd C:\dev\python\py3k\PCbuild8 >del /s ..\*.pyc >c:\dev\python\py3k\PCbuild8\win32debug\python_d.exe -E -tt ../lib/test/regrtest.py -v test_inspect [test OK] >C:\dev\python\py3k\PCbuild8\win32debug\python_d.exe -E -tt ../lib/test/regrtest.py -v test_inspect [test FAILED] If I always use the same path the tests succeed.