[Python-Dev] PEP 370, open questions

Paul Moore p.f.moore at gmail.com
Thu Jan 17 16:01:58 CET 2008


On 17/01/2008, Tim Golden <mail at timgolden.me.uk> wrote:
> > Is %USERPROFILE% not equal to %HOMEDRIVE%%HOMEPATH%?
>
> No. On my machine, for example:
>
> HOMEDRIVE=H:
> HOMEPATH=\
> HOMESHARE=\\vogbs022\it\goldent
>
> USERPROFILE=C:\Documents and Settings\goldent
>
> However, using an account without a mapped home
> drive then yes, they are the same.

Given this information (and the earlier comments about roaming
profiles) I would suggest that Python should use %HOMEDRIVE%HOMEPATH%.
This matches os.path.expanduser('~'). My previous comments were based
on my experience on a machine without a mapped home drive, so I'd
missed the distinction.

Yes, this does contradict the Microsoft guideline that you shouldn't
write to USERPROFILE, but Microsoft themselves set HOMEDRIVE and
HOMEPATH, so they vioated the guidelines, not us :-).

The point here is that we want "the user's home". This is clearly
%HOMEDRIVE%%HOMEPATH% on Windows, guidelines notwithstanding.

Paul.


More information about the Python-Dev mailing list