This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2007年02月06日 17:08 by chris@arachsys.com, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| Python-2.5.rootpath.patch | chris@arachsys.com, 2007年02月06日 17:08 | Patch for getpath.c | ||
| Messages (7) | |||
|---|---|---|---|
| msg31197 - (view) | Author: Chris Webb (chris@arachsys.com) | Date: 2007年02月06日 17:08 | |
reduce() in getpath.c chops down a path to the empty string rather than to /. As a result, if you build python with --prefix='' in the usual way for software to be installed into /, it tries to find its libraries in the current directory instead of in /lib: $ python Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] 'import site' failed; use -v for traceback Python 2.5 (r25:51908, Feb 6 2007, 16:15:42) [GCC 3.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> This is fixed by the attached patch. $ python Python 2.5 (r25:51908, Feb 6 2007, 16:19:38) [GCC 3.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> |
|||
| msg109877 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010年07月10日 15:34 | |
I think the patch should be looked at very carefully as I guess that the reduce function is called all over the place. |
|||
| msg110024 - (view) | Author: Chris Webb (chris@arachsys.com) | Date: 2010年07月11日 16:24 | |
Fortunately reduce() is static within getpath.c, so it should only be necessary to check the handful of callers in there. I've done this, and am reasonably sure it doesn't break anything. In addition, I've given this patch quite a bit of empirical testing, at least under linux/glibc. This has been a persistent bug in Python since 2004 or earlier, and I've needed the attached fix on our Python builds on all our production servers since then, rebasing for every release from 2.4 to the new 2.7. (Our machines don't have legacy /usr dirs so Python is installed to /bin and /lib.) The exact patch I'm using right now against 2.7 is attached, but it's essentially identical to the one I submitted originally against Python 2.4, and later against Python 2.5. |
|||
| msg116605 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010年09月16日 20:27 | |
Can someone with a Linux box try the latest patch please. |
|||
| msg407977 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年12月07日 22:17 | |
getpath.c has been rewritten (see Issue45582). reduce is no longer there. |
|||
| msg407979 - (view) | Author: Chris Webb (chris@arachsys.com) | Date: 2021年12月07日 22:36 | |
Irit Katriel <iritkatriel@gmail.com> added the comment: > getpath.c has been rewritten (see Issue45582). reduce is no longer there. Gosh, this is one I originally reported back in the late 1990s and then again mid-2000s! I've carried a patch in my distribution to make python work in /bin and /lib/python for over 25 years - it'll feel like end of an era to finally be able to drop that local patch. Thanks! (Presumably this will land in Python 11 rather than get backported?) Best wishes, Chris. |
|||
| msg408015 - (view) | Author: Irit Katriel (iritkatriel) * (Python committer) | Date: 2021年12月08日 12:52 | |
> (Presumably this will land in Python 11 rather than get backported?) I believe so. > it'll feel like end of an era to finally be able to drop that local patch. You should mark the occasion somehow, it's not everyday you say goodbye to a 25 year old patch! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:22 | admin | set | github: 44551 |
| 2021年12月08日 15:08:10 | chris@arachsys.com | set | files: - paths.patch |
| 2021年12月08日 12:52:02 | iritkatriel | set | messages: + msg408015 |
| 2021年12月07日 22:36:16 | chris@arachsys.com | set | messages: + msg407979 |
| 2021年12月07日 22:17:00 | iritkatriel | set | status: open -> closed nosy: + iritkatriel messages: + msg407977 resolution: out of date stage: patch review -> resolved |
| 2014年02月03日 19:44:39 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2010年09月16日 20:27:22 | BreamoreBoy | set | messages: + msg116605 |
| 2010年07月11日 16:24:15 | chris@arachsys.com | set | files:
+ paths.patch keywords: + patch messages: + msg110024 |
| 2010年07月10日 15:34:17 | BreamoreBoy | set | versions:
+ Python 3.1, Python 2.7, Python 3.2, - Python 2.6 nosy: + BreamoreBoy messages: + msg109877 stage: test needed -> patch review |
| 2009年03月30日 21:23:59 | ajaksu2 | set | stage: test needed dependencies: + ./configure --prefix=/ breaks, won't build C modules type: behavior components: + Extension Modules versions: + Python 2.6, - Python 2.5 |
| 2008年03月14日 18:51:27 | schmir | set | nosy: + schmir |
| 2007年02月06日 17:08:40 | chris@arachsys.com | create | |