| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…e-117394.qCepkD.rst Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
What happens if /mnt/storage is a mount point, /mnt/storage/link is a symlink to /mnt, and you call ismount('/mnt/storage/link/storage')? I think the new implementation gives a different answer. |
Sorry, something went wrong.
|
Good thinking! The old implementation returns True in that case, the new implementation False. |
Sorry, something went wrong.
|
Serhiy suggested a similar patch previously: #46718 (comment) Compared to Serhiy's patch, this PR adds a abspath() call, which internally calls normpath(). I think that eliminates the remaining edge cases (e.g. trailing slashes, dots in paths, etc). |
Sorry, something went wrong.
|
What's going on here? https://github.com/python/cpython/actions/runs/8504085005/job/23290509561?pr=117395#step:16:481 |
Sorry, something went wrong.
|
Oh, I know why. This test needs to be updated: it monkey patches os.lstat instead of os.stat. |
Sorry, something went wrong.
|
Sorry, but abspath() is unsuitable for this. See details in #117394 (comment). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Benchmark:
python -m timeit -s "import before.posixpath" "before.posixpath.ismount('/Volumes/2GB_001')" && python -m timeit -s "import after.posixpath" "after.posixpath.ismount('/Volumes/2GB_001')" 10000 loops, best of 5: 21.3 usec per loop # before 50000 loops, best of 5: 8.5 usec per loop # after # -> 2.51x faster