[issue22643] Integer overflow in case_operation

STINNER Victor report at bugs.python.org
Fri Apr 3 10:53:54 CEST 2015


STINNER Victor added the comment:

>     self.assertRaises(OverflowError, ("�"*(2**32//12 + 1)).upper)
> MemoryError

Hum, even with the PEP 393, this string is still large: 682 MB.

$ python3
Python 3.4.1 (default, Nov  3 2014, 14:38:10) 
>>> sys.getsizeof("�"*(2**32//12 + 1)) / 1024.**2
682.6667385101318

I guess that Serhiy suggests to put a @bigmemtest decorator on test_case_operation_overflow().

The test expects that large_string.upper() raises immediatly an OverflowError, so I understand that a new string is not created.

Hum, it's strange to have an OverflowError here. Integer overflow on memory allocation usually raises MemoryError, not OverflowError. It looks like unicodeobject.c is not consistent here.

----------
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22643>
_______________________________________


More information about the Python-bugs-list mailing list