Issue #26800: Undocumented support of general bytes-like objects

as paths in os functions is now deprecated.
This commit is contained in:
Serhiy Storchaka 2016-08-06 23:22:08 +03:00
parent 43b586b951
commit d73c31899e
5 changed files with 48 additions and 4 deletions

View file

@ -407,8 +407,10 @@ class PosixTester(unittest.TestCase):
def test_stat(self):
self.assertTrue(posix.stat(support.TESTFN))
self.assertTrue(posix.stat(os.fsencode(support.TESTFN)))
self.assertTrue(posix.stat(bytearray(os.fsencode(support.TESTFN))))
self.assertWarnsRegex(DeprecationWarning,
'should be string, bytes or integer, not',
posix.stat, bytearray(os.fsencode(support.TESTFN)))
self.assertRaisesRegex(TypeError,
'should be string, bytes or integer, not',
posix.stat, None)