Issue 990743: Crash when importing encoded file (original) (raw)

Issue990743

Created on 2004-07-14 09:05 by jneb, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg21571 - (view) Author: Jurjen N.E. Bos (jneb) * Date: 2004-07-14 09:05
Python crashes (!) when it meets a non-ascii character in a file with encoding in use. For example: # encoding: mac-roman ... >>> import user #so we can import >>> import foo Parser/tokenizer.c:366: failed assertion `strlen(str) < (size_t)size' Abort When debugging, I found the StreamReader.readline() routine in codecs.py. It self.calls decode, which does return well; then readline returns, and then the inevitable happens. Readline is called straight from the toplevel (from the viewpoint of the debugger), which probably means calling readline is part of the import logic in C. So the bug must somewhere in there... - Jurjen
msg21572 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2004-07-23 10:13
Logged In: YES user_id=38388 Martin, could you have a look at this ? Thanks.
msg21573 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-08-25 11:31
Logged In: YES user_id=21627 Some time has passed, and now I fail to reproduce the problem. It would have helped if you had attached the actual file that causes the bug, and if you had stated the precise Python version and platform on which this bug occurred. So I'm closing this as "works for me". If you can provide further details, and it hasn't been fixed in 2.4, please submit a new report.
History
Date User Action Args
2022-04-11 14:56:05 admin set github: 40557
2004-07-14 09:05:00 jneb create