[Python-checkins] cpython (3.2): Fix memory error in test_ucn.
serhiy.storchaka
python-checkins at python.org
Mon Jan 21 12:06:21 CET 2013
http://hg.python.org/cpython/rev/f84a6c89ccbc
changeset: 81627:f84a6c89ccbc
branch: 3.2
parent: 81622:7625866f8127
user: Serhiy Storchaka <storchaka at gmail.com>
date: Mon Jan 21 12:59:13 2013 +0200
summary:
Fix memory error in test_ucn.
unicode-escape decoder requires memory for result corresponding to input size.
Fixes test for issue #16335.
files:
Lib/test/test_ucn.py | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -148,13 +148,14 @@
# very very long bogus character name
try:
x = b'\\N{SPACE' + b'x' * (_testcapi.UINT_MAX + 1) + b'}'
+ self.assertEqual(len(x), len(b'\\N{SPACE}') +
+ (_testcapi.UINT_MAX + 1))
+ self.assertRaisesRegex(UnicodeError,
+ 'unknown Unicode character name',
+ x.decode, 'unicode-escape'
+ )
except MemoryError:
raise unittest.SkipTest("not enough memory")
- self.assertEqual(len(x), len(b'\\N{SPACE}') + (_testcapi.UINT_MAX + 1))
- self.assertRaisesRegex(UnicodeError,
- 'unknown Unicode character name',
- x.decode, 'unicode-escape'
- )
def test_main():
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list