Éric Araujo mer...@netwok.org added the comment:
In the absence of tests or doc update, can you tell in English what the new
behavior is? IIUC, when the home dir is not found, all the variables that
depend on it would not exist, right? Or would they be set to None?
--
STINNER Victor victor.stin...@haypocalc.com added the comment:
Main changes of the patch, if the current user has no home directory (no entry
in /etc/passwd) and there is HOME environment variable:
- sysconfig.get_config_vars() doesn't have a 'userbase' variable.
Changes by STINNER Victor victor.stin...@haypocalc.com:
Removed file: http://bugs.python.org/file21640/sysconfig_getuserbase.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
@eric.araujo, @tarek: do you prefer nonexistent_user.patch? I removed
sysconfig_getuserbase.patch, because I agree that an expanded path containing
~ is a bug.
--
___
Python tracker
STINNER Victor victor.stin...@haypocalc.com added the comment:
If the user base cannot be calculated, paths
starting with ~ should not exist or be used at all in this context.
It's not ~ but {userbase} substitution variable.
Here is a new patch implementing this idea: don't create the
Éric Araujo mer...@netwok.org added the comment:
This is the one thing about which I wanted a call: “after the patch, paths
returned by sysconfig may not be fully expanded paths” (i.e. they may start
with '~').
--
___
Python tracker
Tarek Ziadé ziade.ta...@gmail.com added the comment:
Paths that are starting with ~ should be extended with the right value with the
user base. If the user base cannot be calculated, paths starting with ~ should
not exist or be used at all in this context.
Maybe we need to completely reset
STINNER Victor victor.stin...@haypocalc.com added the comment:
I would like Tarek to make a call on this.
So Tarek, what do you think?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
Tarek Ziadé ziade.ta...@gmail.com added the comment:
As discussed w/ Victor, a process should be able to run Python even if its user
does not have a home.
So the call to _getuserbase() should be protected.
But then we have to control that all the code that uses
CONFIG_VARS['userbase'] is
Éric Araujo mer...@netwok.org added the comment:
It’s not just a try/except, it’s a behavior change: after the patch, paths
returned by sysconfig may not be fully expanded paths. I would like Tarek to
make a call on this.
--
assignee: - tarek
___
Charles-Francois Natali neolo...@free.fr added the comment:
I'm not sure whether POSIX warrants anything about this behavior, but nothing
prevents a process from running with a UID not listed in /etc/passwd (or NIS,
whatever). For example, sudo allows running a command with a UID not listed in
STINNER Victor victor.stin...@haypocalc.com added the comment:
Because the patch is simple (just add a try/except), I think that it doesn't
matter if only few people use users without entry in /etc/passwd and we should
fix this issue.
--
___
Python
Éric Araujo mer...@netwok.org added the comment:
Can someone explain how it can happen that a user has no home directory?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
Brian Bi bbi5...@gmail.com added the comment:
I discovered this while I was implementing and testing a sandbox for automatic
evaluation of programs.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
Éric Araujo mer...@netwok.org added the comment:
Can you be more precise? IOW, why is this a Python bug rather than a system
misconfiguration? Note that I don’t know a lot about POSIX, so I’m open to
change my mind.
--
stage: needs patch -
versions: +Python 3.3
STINNER Victor victor.stin...@haypocalc.com added the comment:
This issue remembers me the issue #6612 (failure if the current directory was
removed): the fix was to ignore os.getcwd().
Attached patch ignores os.path.expanduser() error (KeyError) and keeps ~ in the
path. Example without HOME
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
keywords: +patch
Added file: http://bugs.python.org/file21639/sysconfig_getuserbase.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
Changes by STINNER Victor victor.stin...@haypocalc.com:
Removed file: http://bugs.python.org/file21639/sysconfig_getuserbase.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
Added file: http://bugs.python.org/file21640/sysconfig_getuserbase.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo, haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
___
Denis Barmenkov denis.barmen...@gmail.com added the comment:
I saw similar error on Python 2.6 installed on freeBSD.
I had test SVN server and wrote pre-commit hook using python. When remote
developer commited his changes to repository, hook called os.path.expanduser
and exception was raised:
Xuanji Li xua...@gmail.com added the comment:
I tried running bug.c using the svn head of python and got this:
Could not find platform independent libraries prefix
Could not find platform dependent libraries exec_prefix
Consider setting $PYTHONHOME to prefix[:exec_prefix]
Fatal Python error:
Changes by Ned Deily n...@acm.org:
--
Removed message: http://bugs.python.org/msg122051
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
Ned Deily n...@acm.org added the comment:
The problem is reproducible on a current Debian Linux system although with
different results for current versions of Python (only security issues are
accepted against 2.6). Unlike with 2.6, 3.1 reports no error. 2.7 and 3.2
both fail with an
Changes by Ned Deily n...@acm.org:
--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10496
___
New submission from Brian Bi bbi5...@gmail.com:
This bug is Linux-specific.
When Python cannot find the home directory of the user invoking it, it prints
'import site' failed; use -v for traceback.
This occurs only when both of these conditions are met:
1. /etc/passwd contains no entry for
Brian Bi bbi5...@gmail.com added the comment:
This bug is Linux-specific.
When Python cannot find the home directory of the user invoking it, it prints
'import site' failed; use -v for traceback.
This occurs only when both of these conditions are met:
1. /etc/passwd contains no entry for the
27 matches
Mail list logo