Thanks for the link! It might have been aggravated by #117447 - perhaps under emulation, lstat('/') and lstat('/..') are returning different st_inos for some reason.
@barneygale, is this something that you think is worth fixing in os.path.ismount? I don't think Python technically supports emulated environments, so it's not worth reverting any speed improvement or whatever.
The special filename dot-dot shall refer to the parent directory of its predecessor directory. As a special case, in the root directory, dot-dot may refer to the root directory itself.
I think / and /.. always refer to the same directory in practice, and os.path.ismount() uses that fact to detect the root directory. In all other cases, joining .. onto a path and calling lstat() will produce a different stat result. This all seems quite reasonable to me -- I'm not sure if there's anything to fix in ismount().
Activity
nineteendo commented on Apr 24, 2024
Can it not be fixed? Or can we skip certain tests?
barneygale commented on Apr 24, 2024
Could you share a link to a failing GHA workflow please?
brandtbucher commented on Apr 24, 2024
Yeah, we could probably use the --ignorefile option and maintain a text file with a list of individual failures under emulation... any volunteers?
The current PR is a good stopgap though, just to get things passing on PRs (we already skip a bunch of tests, so adding these isn't a huge change).
savannahostrowski commented on Apr 24, 2024
Yes, definitely - https://github.com/python/cpython/actions/runs/8820363755/job/24213816403
I'd like to spend time digging into the emulation failures but this is intended to provide fix in the meantime.
nineteendo commented on Apr 24, 2024
====================================================================== FAIL: test_ismount (test.test_posixpath.PosixPathTest.test_ismount) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/test/test_posixpath.py", line 215, in test_ismount self.assertIs(posixpath.ismount("/"), True) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: False is not True ====================================================================== FAIL: test_is_mount_root (test.test_pathlib.test_pathlib.PathSubclassTest.test_is_mount_root) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/test/test_pathlib/test_pathlib.py", line 1121, in test_is_mount_root self.assertTrue(R.is_mount()) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ AssertionError: False is not true ====================================================================== FAIL: test_is_mount_root (test.test_pathlib.test_pathlib.PathTest.test_is_mount_root) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/test/test_pathlib/test_pathlib.py", line 1121, in test_is_mount_root self.assertTrue(R.is_mount()) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ AssertionError: False is not true ====================================================================== FAIL: test_is_mount_root (test.test_pathlib.test_pathlib.PosixPathTest.test_is_mount_root) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/cpython/cpython/Lib/test/test_pathlib/test_pathlib.py", line 1121, in test_is_mount_root self.assertTrue(R.is_mount()) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ AssertionError: False is not truebarneygale commented on Apr 24, 2024
Thanks for the link! It might have been aggravated by #117447 - perhaps under emulation, lstat('/') and lstat('/..') are returning different st_inos for some reason.
brandtbucher commented on Apr 24, 2024
Ah, I missed that change. Thanks for digging into it.
brandtbucher commented on Apr 24, 2024
GH-118251
brandtbucher commented on Apr 24, 2024
@barneygale, is this something that you think is worth fixing in os.path.ismount? I don't think Python technically supports emulated environments, so it's not worth reverting any speed improvement or whatever.
barneygale commented on Apr 24, 2024
POSIX says:
I think / and /.. always refer to the same directory in practice, and os.path.ismount() uses that fact to detect the root directory. In all other cases, joining .. onto a path and calling lstat() will produce a different stat result. This all seems quite reasonable to me -- I'm not sure if there's anything to fix in ismount().
GH-118246: Exclude test_pathlib and test_posixpath from emulated JIT …
brandtbucher commented on Apr 24, 2024
This is done, then!