[issue36264] os.path.expanduser should not use HOME on windows

Steve Dower report at bugs.python.org
Tue Mar 12 11:17:55 EDT 2019


Steve Dower <steve.dower at python.org> added the comment:

I like the patch, but I'm not sure all the tests are properly preserving the real value of USERPROFILE.

Modifying this value could have a real impact on the rest of the process, so we should be very careful to undo it regardless of test result. (Modifying HOME is not a as big a deal since, as you point out, it's not "real" ;) )

Also, it's probably better to get the current value and check against that, rather than setting it to a known value. One day we might do the right thing and switch expanduser() from the environment variables to the correct API, which would break the test.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36264>
_______________________________________


More information about the Python-bugs-list mailing list