[issue2301] [Py3k]

Hirokazu Yamamoto report at bugs.python.org
Sun Mar 16 14:37:33 CET 2008


New submission from Hirokazu Yamamoto <ocean-city at users.sourceforge.net>:

Following code

# coding: utf-8
print "年"

outputs

C:\Documents and Settings\WhiteRabbit>py3k b.py
  File "b.py", line 3
    print "年"

as expected, but following code

# coding: cp932
print "年"

outputs

C:\Documents and Settings\WhiteRabbit>py3k a.py
  File "a.py", line 4
    [22605 refs]

Probably this happens because PyUnicode_DecodeUTF8 at
Python/pythonrun.c(1757) assumes err->text to be UTF8, but this is not
true when source file is not encoded with UTF8.

# Sorry there is no patch.

----------
components: None
messages: 63576
nosy: ocean-city
severity: normal
status: open
title: [Py3k]
type: behavior
versions: Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2301>
__________________________________


More information about the Python-bugs-list mailing list