Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
Hello. I tracked down source code and found where err-text is set.
Index: Parser/parsetok.c
===
--- Parser/parsetok.c (revision 61411)
+++ Parser/parsetok.c (working copy)
Martin v. Löwis [EMAIL PROTECTED] added the comment:
You are probably right about the source of the problem; I was confusing
it with a regular exception, e.g.
print(年,a)
However, I also fail to reproduce the problem on OSX. I get
File a.py, line 3
print �N
^
SyntaxError:
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
I was confusing it with a regular exception, e.g.
print(年,a)
I'm now invesigating this problem. This comes from another reason.
Please look at fp_setreadl in Parser/tokenizer.c.
This function opens file using codec and doesn't seek to
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
However, I also fail to reproduce the problem on OSX. I get
File a.py, line 3
print �N
^
SyntaxError: invalid syntax
Umm, strange... I can output correct result even if
using euc_jp (my terminal named command prompt
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
I'm now invesigating this problem. This comes from another reason.
Of course, even if this line number problem is fixed, encoding
problem still remains. Probably I'll look at it next.
__
Tracker [EMAIL
Martin v. Löwis [EMAIL PROTECTED] added the comment:
The original issue is now fixed in r61462. Please open another issue for
the case of regular exceptions.
--
resolution: - fixed
status: open - closed
__
Tracker [EMAIL PROTECTED]
Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:
--
title: [Py3k] - [Py3k] No text shown when SyntaxError (when not UTF8)
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2301
__
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
Probably same problem exists in PyErr_ProgramText().
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2301
__
___
Martin v. Löwis [EMAIL PROTECTED] added the comment:
This will involve quite some work to fix. When fetching the code, the
source encoding must be recognized. Contributions are welcome.
(I personally consider this issue minor, as I would encourage users to use
UTF-8 as the source encoding,