diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-09-05 21:08:25 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-09-05 21:08:25 (GMT) |
commit | 609ba81cdbd18c5af1220f242402dc4c7ac923a4 (patch) | |
tree | c66157c42032d62d7217d353387114ab1718aa81 /Lib/posixpath.py | |
parent | bd9adab13801dcd4826488ac9afbd03c4b3f0ccf (diff) | |
download | cpython-609ba81cdbd18c5af1220f242402dc4c7ac923a4.zip cpython-609ba81cdbd18c5af1220f242402dc4c7ac923a4.tar.gz cpython-609ba81cdbd18c5af1220f242402dc4c7ac923a4.tar.bz2 |
SF # 555779, import user doesn't work with CGIs
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r-- | Lib/posixpath.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 6c66689..d5d2621 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -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: |