-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_sysconfig failure when prefix matches /site #54295
Comments
test_sysconfig on Python 3.2a3 fails with AssertionError: Python-3.2a3$ ./python Lib/test/regrtest.py -v test_sysconfig ====================================================================== Traceback (most recent call last):
File "/home/sjef/src/python/Python-3.2a3/Lib/test/test_sysconfig.py", line 278, in test_user_similar
self.assertEquals(user_path, global_path.replace(base, user))
AssertionError: '/home/sjef/.local/lib/python3.2/site-packages' != '/home/sjef/.local/lib/python3.2/home/sjef/.local-packages'
- /home/sjef/.local/lib/python3.2/site-packages
? ^^
+ /home/sjef/.local/lib/python3.2/home/sjef/.local-packages
? +++++ ^ ++++++++ Ran 12 tests in 0.145s FAILED (failures=1)
test test_sysconfig failed -- Traceback (most recent call last):
File "/home/sjef/src/python/Python-3.2a3/Lib/test/test_sysconfig.py", line 278, in test_user_similar
self.assertEquals(user_path, global_path.replace(base, user))
AssertionError: '/home/sjef/.local/lib/python3.2/site-packages' != '/home/sjef/.local/lib/python3.2/home/sjef/.local-packages'
- /home/sjef/.local/lib/python3.2/site-packages
? ^^
+ /home/sjef/.local/lib/python3.2/home/sjef/.local-packages
? +++++ ^ ++++++++ 1 test failed: |
Thanks for the report. Can you tell us what ./configure line you used before running make? Or maybe you edited site.py or created a sitecustomize.py? Tarek, Antoine: Is “Distutils” the right component for sysconfig bugs? (I thought it would be “Library”.) |
"./configure --prefix=/site" on Ubuntu. |
It's with 'purelib' because my prefix "/site" matches "/site-packages". --- Lib/test/test_sysconfig.py~ 2010-09-20
+++ Lib/test/test_sysconfig.py 2010-10-14
@@ -278 +278 @@ class TestSysConfig(unittest.TestCase):
- self.assertEquals(user_path, global_path.replace(base, user))
+ self.assertEquals(user_path, global_path.replace(base, user, 1)) |
Thanks for the fix, good catch! Do you want to write a patch to test_sysconfig to add a test? Otherwise I’ll do it. |
I wrote too fast, I thought your diff was for sysconfig itself, not test_sysconfig. |
Attaching a patch with your two suggestions. Two things worry me and prevent me from committing right now:
|
�,AC�ric Araujo writes:
Not quite, since I suggested I should have mentioned, the join appends a directory terminator base = "/site" |
I’ve looked into it and converting the test to distutils.sysconfig is not trivial: the get_path function is wholly different in distutils, and I’m not even sure it’s possible to get the paths like test_sysconfig does.
I think I can commit this fix for a minor issue in a test without worrying about regressions. I manually tested and it’s fixed.
If this can’t happen, let us not worry about it :) |
New changeset 1e01543c3d0a by Éric Araujo in branch '3.2': New changeset 0968acf0e6db by Éric Araujo in branch 'default': |
New changeset 4dcbae65df3f by Éric Araujo in branch '2.7': |
Done! Thanks again. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: