summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-01-17 12:19:45 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-01-17 12:19:45 +0000
commit1b64331f49881f23fbbdbab8a9e152aa2188d5b6 (patch)
treea8bc538f6d46e6b7877141e1321ecc1c614616e9 /Lib/test
parentf3f5a1333be0623922798291286ae18c90617804 (diff)
downloadcpython-git-1b64331f49881f23fbbdbab8a9e152aa2188d5b6.tar.gz
Merged revisions 77571 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r77571 | antoine.pitrou | 2010-01-17 13:16:23 +0100 (dim., 17 janv. 2010) | 4 lines Issue #7561: Fix crashes when using bytearray objects with the posix module. ........
Diffstat (limited to 'Lib/test')
-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 62edd6c4fb..907f94312d 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,