Barney Gale <barney.g...@gmail.com> added the comment:
Thanks for taking a look, Steve. A couple things maybe worth noting: Firstly, `os.path.expanduser()` is already documented to return the path unchanged if the home directory can't be resolved: > If the expansion fails or if the path does not begin with a tilde, the path > is returned unchanged. Secondly, `ntpath.expanduser()` already returns the path unchanged if neither USERPROFILE nor HOMEPATH are in the environment. An alternative would be to leave `ntpath.expanduser()` method alone, and forgo the slightly-improved error checking in `WindowsPath.expanduser()` in the name of conformity. Or perhaps we could add a `stict` parameter to `expanduser()`? I can understand why this could be seen as change for change's sake. In fact this code removal greatly aids my work towards addressing bpo-24132. Thanks again ---------- resolution: -> not a bug stage: patch review -> resolved status: open -> closed versions: +Python 3.9 -Python 3.10 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39899> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com