SF # 555779, import user doesn't work with CGIs
This commit is contained in:
parent
bd9adab138
commit
609ba81cdb
|
@ -303,8 +303,10 @@ def expanduser(path):
|
|||
i = i + 1
|
||||
if i == 1:
|
||||
if not 'HOME' in os.environ:
|
||||
return path
|
||||
userhome = os.environ['HOME']
|
||||
import pwd
|
||||
userhome = pwd.getpwuid(os.getuid())[5]
|
||||
else:
|
||||
userhome = os.environ['HOME']
|
||||
else:
|
||||
import pwd
|
||||
try:
|
||||
|
|
|
@ -26,6 +26,8 @@ import os
|
|||
home = os.curdir # Default
|
||||
if 'HOME' in os.environ:
|
||||
home = os.environ['HOME']
|
||||
elif os.name == 'posix':
|
||||
home = os.path.expanduser("~/")
|
||||
elif os.name == 'nt': # Contributed by Jeff Bauer
|
||||
if 'HOMEPATH' in os.environ:
|
||||
if 'HOMEDRIVE' in os.environ:
|
||||
|
|
Loading…
Reference in New Issue