As it is implemented in ntpath.py this function doesn't expand environment variables written the "DOS way"/%VAR_NAME%. Is there any reason, besides time to do it, why this functionality isn't included? I have an Emacs diff for ntpath.py plus a diff for test_ntpath.py that tests the new functionality, if the functionality is wanted.