-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
tests.test_resources:NamespaceTests.test_two_levels_deep fails on OS X because of temp folder strangeness #271
Comments
Original comment by msabramo (Bitbucket: msabramo, GitHub: msabramo): https://bitbucket.org/pypa/setuptools/pull-request/93/fix-test_two_levels_deep-failure-on-os-x/diff fixes this. |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): This issue was raised in previously, but only in Pull Request #74. In that commit, a discussion began about the right way to fix this issue. The issue arises on Mac OS X because the tempdir is in a symlink folder and apparently there's some inconsistency in how these paths resolved. |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): hongqn says: Actually, if I do not change here, the value of
|
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): Then I say: Aha. So it looks like you may have uncovered a bug (or at least inconsistency) in the code. I don't think the expectation as you've written is one that we want to enforce. Instead, we should (a) update the tests to match the best expectation in the case of a symlinked package root, then (b) update the implementation to behave better in this case. |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): Then hongqn again: The place where realpath comes is in stdlib's pkgutil module: http://hg.python.org/cpython/file/f01413758114/Lib/pkgutil.py#l212 It seems the module loaded by pkgutil will use realpath, but import statement simply uses whatever string in sys.path.
It output:
Should this be considered as a Python bug? |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): Then me again: I don't know if that's a bug or not. I traced the specification of the package loader to PEP 302, which doesn't say. I suggest sending an e-mail to distutils-sig or maybe python-dev for an opinion. It does seem like an unnecessary inconsistency. Other avenues to pursue - investigate the loader code and see if it indicates anything about resolving the realpath (is there a comment explaining why it's there?). Run blame on the line where realpath is run to see when it was changed and if the commit message there explained anything. Also, do all Python versions have the same behavior? |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): hongqn also mentions: The code calling pkgutil in pkg_resources: https://bitbucket.org/pypa/setuptools/src/01ec41e9b983dd7d1fdb81b3d07d7b43217fba3e/pkg_resources.py?at=default#cl-1954 |
Originally reported by: msabramo (Bitbucket: msabramo, GitHub: msabramo)
The text was updated successfully, but these errors were encountered: