Nmap Development mailing list archives

Re: Non-ASCII user names on Windows; internationalization fun


From: Dirk Loss <lists () dirk-loss de>
Date: Sun, 14 Sep 2008 20:20:47 +0200

David Fifield wrote:
Currently we use os.path.expanduser("~"), decoded from the filesystem encoding, to get the user's home directory.
os.path.expanduser reads the environment variable HOME, which simply
doesn't work for users with the names we've discussed. You get back a
bunch of question marks. If someone knows a good way to get the home
directory using the Python standard library, I'm all ears.

Googling turned up this potential solution [1]:
home = os.path.expanduser("~").decode(sys.getfilesystemencoding())

I haven't been able to test whether it really works, though.

Regards
Dirk

[1] https://bugs.launchpad.net/elisa/0.3/+bug/242179

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: