-
Notifications
You must be signed in to change notification settings - Fork 297
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
Usage of pathlib.Path.resolve()
breaks symlink trees / forests
#711
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Thanks for reporting @EricCousineau-TRI. |
Nice! Didn't see See #712 |
Ah, was about to file bug report for Python, but looks like it's already fixed in newer (dev) docs: |
Description
Unfortunate case of spacebar heating 😅
We have some
bazel
code which runs notebooks.Bazel works by creating a "runfiles" directory, which contains a series of symlinks from files that may not come from the same directories.
#415 introduced the following logic:
jupyter_server/jupyter_server/serverapp.py
Lines 2542 to 2545 in 55d9f68
However (as a surprise to me),
pathlib.Path.resolve()
will not only make a path absolute, but it will resolve against symlinks.This is an internal project, but similar code was hoisted to one of our public projects:
https://github.com/RobotLocomotion/drake/tree/v1.0.0/tools/jupyter
Reproduce
No direct repro script yet; however, I confirmed this will break Bazel out of sandboxes.
If I inject some print statements in this area, I get the following:
Expected behavior
It should only get absolute path, not the real path, and it should work fine.
Possible workarounds:
os.path.realpath
on the notebookrunfiles
serverapp.py
to useos.path.abspath()
- mehContext
Troubleshoot Output
Command Line Output
N/A (I believe)Browser Output
N/AThe text was updated successfully, but these errors were encountered: