Commit 1e744b80 authored by Neal Norwitz's avatar Neal Norwitz

SF # 555779, import user doesn't work with CGIs

parent e45fcd87
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment