mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
Issue #7561: Fix crashes when using bytearray objects with the posix
module.
This commit is contained in:
parent
4c1718c0e3
commit
1119a64916
3 changed files with 13 additions and 1 deletions
|
@ -564,6 +564,14 @@ class ExecTests(unittest.TestCase):
|
|||
def test_execvpe_with_bad_arglist(self):
|
||||
self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)
|
||||
|
||||
class ArgTests(unittest.TestCase):
|
||||
def test_bytearray(self):
|
||||
# Issue #7561: posix module didn't release bytearray exports properly.
|
||||
b = bytearray(os.sep.encode('ascii'))
|
||||
self.assertRaises(OSError, os.mkdir, b)
|
||||
# Check object is still resizable.
|
||||
b[:] = b''
|
||||
|
||||
class Win32ErrorTests(unittest.TestCase):
|
||||
def test_rename(self):
|
||||
self.assertRaises(WindowsError, os.rename, support.TESTFN, support.TESTFN+".bak")
|
||||
|
@ -750,6 +758,7 @@ else:
|
|||
|
||||
def test_main():
|
||||
support.run_unittest(
|
||||
ArgTests,
|
||||
FileTests,
|
||||
StatAttributeTests,
|
||||
EnvironTests,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue