mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #26800: Undocumented support of general bytes-like objects
as paths in os functions is now deprecated.
This commit is contained in:
parent
43b586b951
commit
d73c31899e
5 changed files with 48 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue