Guido van Rossum added the comment:
In release25-maint, PyErr_Print() should be replaced with
PyErr_Clear() also.
Committed revision 58991.
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
atsuo ishimoto added the comment:
That's fine with me. Please replace PyErr_Print() with PyErr_Clear().
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
___
Guido van Rossum added the comment:
atsuo ishimoto added the comment:
That's fine with me. Please replace PyErr_Print() with PyErr_Clear().
Done.
Committed revision 58471.
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
atsuo ishimoto added the comment:
Sorry for insufficient comment.
When a codec raised an exception, I think the exception should be
reported. Otherwise, user cannot know why Python prints broken line
of code.
Should we silently clear the exception raised by codecs, or print a
message such
Martin v. Löwis added the comment:
Should we silently clear the exception raised by codecs, or print a
message such as Codec raised an exception while processing compile
error. ?
Can you create a test case that triggers that specific problem?
Regards,
Martin
atsuo ishimoto added the comment:
Codecs would hardly ever raises exception here.
Usually, exception raised here would be a MemoryError. The unicode
string we are trying to encode is just decoded by same codec. If codec
raises exception other than MemoryError, the codec will likely have
Guido van Rossum added the comment:
There are tons of situations where such an exception will be
suppressed, ofr better or for worse. I don't think this one deserves
such a radical approach.
On 10/11/07, atsuo ishimoto [EMAIL PROTECTED] wrote:
atsuo ishimoto added the comment:
Codecs would
Martin v. Löwis added the comment:
ishimoto: in dec_utf8, there is a PyErr_Print call. What is the purpose
of this call?
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
Guido van Rossum added the comment:
PyErr_Print() is called to report exception raised by codec.
If PyUnicode_DecodeUTF8() or PyUnicode_AsEncodedString() return NULL,
PyErr_Print() is called.
This comment is not very helpful; it describes what happens, but not
why, or whether that is a good
atsuo ishimoto added the comment:
PyErr_Print() is called to report exception raised by codec.
If PyUnicode_DecodeUTF8() or PyUnicode_AsEncodedString() return NULL,
PyErr_Print() is called.
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
Martin v. Löwis added the comment:
Thanks for the patch. It wouldn't work as-is, because it broke PGEN. I
fixed that, and committed the change as r57961 and r57962.
--
resolution: - accepted
status: open - closed
versions: +Python 2.5, Python 2.6
_
Guido van Rossum added the comment:
We should make sure this is *not* merged into Py3k; there, things remain
unicode until they're printed, at which point the only encoding that
matters is the output file's encoding.
_
Tracker [EMAIL PROTECTED]
Changes by Georg Brandl:
--
title: Patch for bug #780725 - Use correct encoding for printing SyntaxErrors
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
13 matches
Mail list logo