New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compile of code with incorrect encoding yields MemoryError #40451
Comments
The following code will fail in both Python 2.3 and compile("# -*- coding: mbcs -*-", "test.py", "exec") This has been reproduced on the following platforms: Linux x86 I realize this is an invalid encoding but it would be |
Logged In: YES I assume the behaviour occurrs when an unknown encoding is compile("# -*- coding: xxx -*-", "test.py", "exec") It should probably raise a SyntaxError, as trying to import The problem seems that when |
Logged In: YES Here's a simple and seemingly effective patch. I'm not sure |
Logged In: YES Duplicate of bpo-772896. This has been fixed in CVS. It's up |
Logged In: YES No need to backport -- the solution is quite simple. I was |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: