OS-4023: lx brand: Python regression test failure in test_fileio.py

Details

Issue Type:Bug
Priority:4 - Normal
Status:Resolved
Created at:2015-03-10T16:52:03.000Z
Updated at:2015-03-11T16:25:39.000Z

People

Created by:Bryan Cantrill [X]
Reported by:Bryan Cantrill [X]
Assigned to:Bryan Cantrill [X]

Resolution

Won't Fix: The problem described is an issue which will never be fixed.
(Resolution Date: 2015-03-11T16:25:39.000Z)

Labels

lxbrand

Description

See OS-4014 and OS-4015 for test suite details.

Comments

Comment by Bryan Cantrill [X]
Created at 2015-03-11T16:25:39.000Z

So as it turns out, this test is failing because it's finding that /dev/tty is seekable. It's unclear why this is being tested for -- it's very obscure (and irrelevant) implementation-defined behavior that already varies from system to system. Here's the test code in question:

            if sys.platform != "win32":
                try:
                    f = _FileIO("/dev/tty", "a")
                except EnvironmentError:
                    # When run in a cron job there just aren't any
                    # ttys, so skip the test.  This also handles other
                    # OS'es that don't support /dev/tty.
                    pass
                else:
                    self.assertEqual(f.readable(), False)
                    self.assertEqual(f.writable(), True)
                    if sys.platform != "darwin" and \
                       'bsd' not in sys.platform and \
                       not sys.platform.startswith('sunos'):
                        # Somehow /dev/tty appears seekable on some BSDs
                        self.assertEqual(f.seekable(), False)
                    self.assertEqual(f.isatty(), True)
                    f.close()

Given that no app can reasonably depend on the fact that /dev/tty is seekable on us (and not seekable on Linux) and given that fixing this is unlikely to come at zero cost or risk, I'm closing this out as Won't Fix -- we can reevaluate in the (unlikely) event that an app finds a way to trip on this.