]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport 1.52:
authorRaymond Hettinger <python@rcn.com>
Sun, 6 Oct 2002 22:11:13 +0000 (22:11 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 6 Oct 2002 22:11:13 +0000 (22:11 +0000)
SF # 555779, import user doesn't work with CGIs

Lib/posixpath.py

index c342bbcf198e2498d9d4aac9985df0457a1449e6..81358cae377b6bfc441d00188d4a0cad410c6d70 100644 (file)
@@ -306,8 +306,10 @@ def expanduser(path):
         i = i + 1
     if i == 1:
         if not os.environ.has_key('HOME'):
-            return path
-        userhome = os.environ['HOME']
+            import pwd
+            userhome = pwd.getpwuid(os.getuid())[5]
+        else:
+            userhome = os.environ['HOME']
     else:
         import pwd
         try: