[Python-Dev] Memory Error the right error for coding cookie promise violation?

Neal Norwitz nnorwitz at gmail.com
Tue Feb 21 09:28:06 CET 2006


On 2/20/06, Bengt Richter <bokr at oz.net> wrote:
> Perhaps a more informative message would be nice.
> Here's an easy way to trigger it:
>
>  >>> compile("#-*- coding: ascii -*-\nprint 'ab%c'\n"%0x80, '','exec')
>  Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>  MemoryError

This was fixed in 2.5, but looks like it wasn't backported.  I don't
recall exactly why. -- n

Python 2.5a0 (trunk:42526M, Feb 20 2006, 16:00:48)
>>> compile("#-*- coding: ascii -*-\nprint 'ab%c'\n"%0x80, '','exec')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 0
SyntaxError: unknown encoding: ascii


More information about the Python-Dev mailing list