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
Regards,
Bengt Richter