Patches item #1031213, was opened at 2004-09-20 06:37 Message generated for change (Comment added) made by nnorwitz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1031213&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Parser/Compiler Group: None Status: Open Resolution: None >Priority: 6 Submitted By: atsuo ishimoto (ishimoto) Assigned to: Neal Norwitz (nnorwitz) Summary: Patch for bug #780725 Initial Comment: When SyntaxError occurs and the module contains source encodings definition, current implementation prints error line in UTF8. This patch reverts the line into original encoding for printing. This patch calls some memory-allocation APIs such as PyUnicode_DecodeUTF8. I'm not sure I can (or should) call PyErr_Clear() here if error happened. ---------------------------------------------------------------------- >Comment By: Neal Norwitz (nnorwitz) Date: 2006-07-30 10:04 Message: Logged In: YES user_id=33168 Note to self (or anyone interested): remember to look into this. ---------------------------------------------------------------------- Comment By: atsuo ishimoto (ishimoto) Date: 2006-03-17 23:06 Message: Logged In: YES user_id=463672 Sorry for my laziness. I revised a patch for current trunk. - Use "replace" for recoding source - Reports error with PyErr_Print() - Test case ---------------------------------------------------------------------- Comment By: atsuo ishimoto (ishimoto) Date: 2005-10-12 23:38 Message: Logged In: YES user_id=463672 Thanks for your comments. I'll post a revised patch and test case later. ---------------------------------------------------------------------- Comment By: M.-A. Lemburg (lemburg) Date: 2005-10-02 11:08 Message: Logged In: YES user_id=38388 Please use the "replace" error handler when recoding the source line to Unicode - this will reduce the probability of the conversion failing. If you do get an error, it's likely going to be an unknown encoding or less likely a memory problem. Please add some logic to deal with these errors as well - currently you don't call PyError_Clear() or take some other action which may lead to confusing error reports (e.g. error popping up randomly during program execution due to the set error). ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2005-10-01 22:45 Message: Logged In: YES user_id=33168 I'm hoping that someone more familiar with unicode could take a look at this. The patch looks ok to me, but I don't know how to test that it works. I'm inclined to accept it, unless I hear otherwise. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1031213&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches