[Patches] [ python-Patches-1676135 ] Remove trailing slash from --prefix
SourceForge.net
noreply at sourceforge.net
Tue Mar 20 23:06:58 CET 2007
Patches item #1676135, was opened at 2007-03-07 23:30
Message generated for change (Comment added) made by sonderblade
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1676135&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Björn Lindqvist (sonderblade)
Assigned to: Nobody/Anonymous (nobody)
Summary: Remove trailing slash from --prefix
Initial Comment:
Two tests in test_inspect.py failed for me with the following traceback:
======================================================================
FAIL: test_stack (__main__.TestInterpreterStack)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test/test_inspect.py", line 92, in test_stack
(modfile, 16, 'eggs', [' st = inspect.stack()\n'], 0))
AssertionError: ('/tmp/install//lib/python2.6/test/inspect_fodder.py', 16, 'eggs', [' st = inspect.stack()\n'], 0) != ('/tmp/install/lib/python2.6/test/inspect_fodder.py', 16, 'eggs', [' st = inspect.stack()\n'], 0)
This happened because I configured Python with "./configure --prefix=/tmp/install/" and autoconf automagically created paths such as ${prefix}/lib so it got a double slash.
Double slashes are completely harmless on Unix and test_inspect.py is probably wrong in comparing two paths like that. Nevertheless, they are ugly and I think it is worthwhile to eliminate them. So here is patch that does that by adding a "hack" to configure.in.
----------------------------------------------------------------------
>Comment By: Björn Lindqvist (sonderblade)
Date: 2007-03-20 23:06
Message:
Logged In: YES
user_id=51702
Originator: YES
File Added: fix-prefix-with-trailing-slash-problem-2.patch
----------------------------------------------------------------------
Comment By: Björn Lindqvist (sonderblade)
Date: 2007-03-16 13:27
Message:
Logged In: YES
user_id=51702
Originator: YES
Ok, I'll add a specialcase for that which should be trivial. Also, the
manual for sys.prefix is a little vague and probably needs an update.
----------------------------------------------------------------------
Comment By: Georg Brandl (gbrandl)
Date: 2007-03-16 09:26
Message:
Logged In: YES
user_id=849994
Originator: NO
I'd still specialcase prefix == "/". Currently, with your patch it ends up
as
sys.prefix == "", which is bad if someone does
x = os.path.join(sys.prefix, "lib", ...)
I think who configures with --prefix=/ can live with the double slashes.
----------------------------------------------------------------------
Comment By: Collin Winter (collinwinter)
Date: 2007-03-16 03:49
Message:
Logged In: YES
user_id=1344176
Originator: NO
Sounds good to me. How about you, Georg?
----------------------------------------------------------------------
Comment By: Björn Lindqvist (sonderblade)
Date: 2007-03-14 00:05
Message:
Logged In: YES
user_id=51702
Originator: YES
Yes, that could be fixed too. But all tracebacks originating from the
standard library also get the double slash:
>>> import fnmatch
>>> fnmatch.filter(1, 2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/bjourne/install//lib/python2.6/fnmatch.py", line 46, in
filter
res = translate(pat)
File "/home/bjourne/install//lib/python2.6/fnmatch.py", line 78, in
translate
i, n = 0, len(pat)
TypeError: object of type 'int' has no len()
IMHO, that is ugly enough that it ought to be fixed.
----------------------------------------------------------------------
Comment By: Collin Winter (collinwinter)
Date: 2007-03-12 18:37
Message:
Logged In: YES
user_id=1344176
Originator: NO
I think I'd rather fix the tests, using something like os.path.normpath().
----------------------------------------------------------------------
Comment By: Björn Lindqvist (sonderblade)
Date: 2007-03-08 21:15
Message:
Logged In: YES
user_id=51702
Originator: YES
It does. Autoconf sees that prefix is the empty string "", but as the
variable is defined it does not replace it with the default /usr/local. So
it should be safe. Although it would be nice if someone else could test it
too.
----------------------------------------------------------------------
Comment By: Georg Brandl (gbrandl)
Date: 2007-03-08 09:08
Message:
Logged In: YES
user_id=849994
Originator: NO
Does this work if the prefix is "/"?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1676135&group_id=5470
More information about the Patches
mailing list