summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-17 12:16:23 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-17 12:16:23 (GMT)
commit1119a649167f8057f75b8fd26fa6cd2c1fc59a83 (patch)
treed3edfe03010522cb00d7103c1c8e7ed06a759283 /Lib/test/test_os.py
parent4c1718c0e34e955423db92f1b69d57fc580ea57d (diff)
downloadcpython-1119a649167f8057f75b8fd26fa6cd2c1fc59a83.zip
cpython-1119a649167f8057f75b8fd26fa6cd2c1fc59a83.tar.gz
cpython-1119a649167f8057f75b8fd26fa6cd2c1fc59a83.tar.bz2
Issue #7561: Fix crashes when using bytearray objects with the posix
module.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 62edd6c..907f943 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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,