[Patches] [ python-Patches-1031213 ] Patch for bug #780725

SourceForge.net noreply at sourceforge.net
Thu Oct 13 08:38:48 CEST 2005


Patches item #1031213, was opened at 2004-09-20 22:37
Message generated for change (Comment added) made by ishimoto
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: 5
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: atsuo ishimoto (ishimoto)
Date: 2005-10-13 15: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-03 03: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-02 14: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


More information about the Patches mailing list