[Python-Dev] PEP 370, open questions (original) (raw)

Paul Moore p.f.moore at gmail.com
Thu Jan 17 17:27:07 CET 2008


The best we can hope for is to point to HOMEDRIVE/PATH as Paul suggested (possibly rewiring os.path.expanduser to try that first, depending on Win2K stuff)

os.path.expanduser uses HOMEDRIVE/HOMEPATH. It checks for an explicit HOME (set manually by the user, this isn't a Windows standard name) first. (At least in 2.5, see ntpath.py)

I think consistency with os.path.expanduser('~') is a significant benefit.

and make sure the user is aware of what might happen if the HOMEDRIVE/PATH is really a pointer to a network-based profile.

Given that os.path.expanduser allows HOME to override HOMEDRIVE/HOMEPATH, users in this position could set an explicit HOME.

The one downside of following expanduser is that Christian's code is in C, where ntpath.expanduser is in Python, so there are 2 versions to keep in sync. Maybe Christian could expose his C implementation, which ntpath.expanduser could then reuse?

Paul.



More information about the Python-Dev mailing list