TypeError while checking for permissions with os.access() on windows xp

Stephen Hansen apt.shansen at gmail.com
Sat Aug 22 15:30:16 EDT 2009


>
>
> WTF??
> Why on IDLE it works, but when i run this script in cmd.exe, the
> os.getenv('HOME') goes NoneType?
> I'm to newbie yet to understand this  :/
>

HOME is simply not a standard environment variable that Windows provides.
Any program can set/add environment variables as it deems fit; in this case
it seems IDLE is setting one, but you can't rely on it outside of IDLE.

If you do os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] it may be what
you want.

Start up cmd.exe, type 'set' -- that's the default/standard environment
variables you have to work with. That's it.

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090822/3774f36a/attachment.html>


More information about the Python-list mailing list