This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients benjamin.peterson, ezio.melotti, lemburg, mark.dickinson, pitrou, serhiy.storchaka, vstinner
Date 2012-10-31.22:08:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1351721312.44.0.922371522929.issue16335@psf.upfronthosting.co.za>
In-reply-to
Content
I have 12 GB of RAM. Let's test.

$ ./python 
Python 3.4.0a0 (default:8573a86c11b5+, Oct 31 2012, 22:17:00) 
[GCC 4.6.3 20120306 (Red Hat 4.6.3-2)] on linux
>>> x=(b'\\N{WHITE SMILING FACE' + b'x' * 2**32 + b'}')
>>> len(x)
4294967318
>>> y=x.decode('unicode-escape')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError

There is no crash, but it would be better to get a SyntaxError("(unicode error) 'unicodeescape' codec can't decode bytes in position 0-6: unknown Unicode character name") instead.

I propose to only fix this issue in Python 3.4.
History
Date User Action Args
2012-10-31 22:08:32vstinnersetrecipients: + vstinner, lemburg, mark.dickinson, pitrou, benjamin.peterson, ezio.melotti, serhiy.storchaka
2012-10-31 22:08:32vstinnersetmessageid: <1351721312.44.0.922371522929.issue16335@psf.upfronthosting.co.za>
2012-10-31 22:08:32vstinnerlinkissue16335 messages
2012-10-31 22:08:32vstinnercreate