posixpath.ismount() on non-posix systems
I've just filed bug #776207: test_posixpath fails on MacOS9. The problem
is that it expects posixpath.ismount('/') to return true. But on OS9 it
returns
false. I'm unsure as to the correct behaviour of this on non-posix
systems,
does anyone have a suggestion? How does it behave on Windows? Should
test_posixpath
maybe only run some of the tests on non-posix systems?
--
Jack Jansen,
Jack Jansen
I've just filed bug #776207: test_posixpath fails on MacOS9. The problem is that it expects posixpath.ismount('/') to return true. But on OS9 it returns false. I'm unsure as to the correct behaviour of this on non-posix systems, does anyone have a suggestion? How does it behave on Windows? Should test_posixpath maybe only run some of the tests on non-posix systems?
This last seems the right answer. Cheers, mwh -- Presumably pronging in the wrong place zogs it. -- Aldabra Stoddart, ucam.chat
Jack Jansen wrote:
I've just filed bug #776207: test_posixpath fails on MacOS9. The problem is that it expects posixpath.ismount('/') to return true.
Checking ismount() was added as part of the port to PyUnit.
But on OS9 it returns false. I'm unsure as to the correct behaviour of this on non-posix systems, does anyone have a suggestion? How does it behave on Windows? Should test_posixpath maybe only run some of the tests on non-posix systems?
If there isn't any path that reliably returns True or False the only test we could do is: assert_(isinstance(posixpath.ismount("/"), bool) This would at least cover the code. Bye, Walter Dörwald
Jack Jansen wrote:
Should test_posixpath maybe only run some of the tests on non-posix systems?
Seems to me it doesn't make sense to test posixpath.ismount on a non-posix system, since it examines the file system. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
Jack Jansen writes:
I've just filed bug #776207: test_posixpath fails on MacOS9. The problem is that it expects posixpath.ismount('/') to return true. But on OS9 it returns false. I'm unsure as to the correct behaviour of this on non-posix systems, does anyone have a suggestion? How does it behave on Windows? Should test_posixpath maybe only run some of the tests on non-posix systems?
There are two groups of functions in the *path module implementations: what I call "path algebra" functions, that only implement string operations specific to paths in the native syntax of the various platforms, and functions that have to care about the system they're running on, and understand the relevant set of filesystem semantics. I practice, it's really convenient to keep these together, but the tests should probably be re-examined. Tests of pure string operations should be run regardless of the platform on which the tests are running, and tests of functions that care about the host platform should only be run on the appropriate platforms. posixpath.ismount() should definately not be getting run on non-posix platforms. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
On woensdag, jul 23, 2003, at 17:32 Europe/Amsterdam, Fred L. Drake, Jr. wrote:
There are two groups of functions in the *path module implementations: what I call "path algebra" functions, that only implement string operations specific to paths in the native syntax of the various platforms, and functions that have to care about the system they're running on, and understand the relevant set of filesystem semantics.
I practice, it's really convenient to keep these together, but the tests should probably be re-examined. Tests of pure string operations should be run regardless of the platform on which the tests are running, and tests of functions that care about the host platform should only be run on the appropriate platforms.
posixpath.ismount() should definately not be getting run on non-posix platforms.
Fully agreed here. How about the following solution: we leave
test_posixpath
as-is for 2.3 and I add a note to the MacPython-OS9 readme that this
failure
is expected, and then we fix the test in this way for 2.3.1?
--
- Jack Jansen
Jack Jansen writes:
Fully agreed here. How about the following solution: we leave test_posixpath as-is for 2.3 and I add a note to the MacPython-OS9 readme that this failure is expected, and then we fix the test in this way for 2.3.1?
Sounds good to me! Changing code in 2.3 for this isn't worth the risk. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation
participants (6)
-
Barry Warsaw
-
Fred L. Drake, Jr.
-
Greg Ewing
-
Jack Jansen
-
Michael Hudson
-
Walter Dörwald