[Python-Dev] ntpath r54364 (was: PEP 370, open questions)

Christian Heimes lists at cheimes.de
Thu Jan 17 19:32:22 CET 2008


Paul Moore wrote:
> I'd recommend that this change be reverted. To correctly get another
> user's home directory would involve reading (via the registry, or
> maybe some utility function I couldn't find at a quick glance) the
> value of HOMEDRIVE/HOMEPATH which is set for the other user. (In fact,
> given that I guess these could be set in a login script, it's entirely
> possible that the information simply isn't available).

I concur! The changes should be reverted. The implementation is most
likely to fail in more elaborate cases, e.g. c:\users\a\alpha or
c:\users\groupa\name. The proper way for a ~user implementation is a
bunch of Win32 API calls.

Christian


More information about the Python-Dev mailing list