classification
Title: Python 3.2.2 Mac installer version doesn't accept multibyte character in interactive mode
Type: behavior Stage:
Components: macOS Versions: Python 3.2
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: ats, ned.deily, r.david.murray, ronaldoussoren, willingc
Priority: normal Keywords:

Created on 2012-01-11 07:36 by ats, last changed 2016-06-24 14:18 by willingc. This issue is now closed.

Messages (9)
msg151035 - (view) Author: Atsushi Shibata (ats) Date: 2012-01-11 07:36
I installed Python 3.2.2 on Macintosh(Snow Leopard), by using installer on python.org.
In interactive mode, it does not accept multibyte character. When I type Japanese character on it, it changes to ?.
I tried to make Python 3.2.2 by using tar ball on the same machine. I can type Japanese character in interactive mode.
I guess it's because of some minor issue, such as compile option is different etc.

Thanks in advance.
msg151040 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2012-01-11 08:11
Can you give the exact steps of what you did to demonstrate the problem?  Also, there are two OS X installers for Python 3.2.2.  Which one did you install?  (The two lines of version information when starting Python is enough to identify which one it is.)
msg151044 - (view) Author: Atsushi Shibata (ats) Date: 2012-01-11 08:53
The procedure is following.

1. type "python" in the terminal.app to launch interactive mode.
2. type 'あ' in it.

And I use Mac OS X 64-bit/32-bit Installer (3.2.2) for Mac OS X 10.6 and 10.7.
Here is the first 2 lines of initial message.

Python 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:59) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

thanks :-)
msg151046 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2012-01-11 09:17
I am not familiar with the Japanese input methods available in OS X. But using copy and paste with an US UTF-8 locale, it seems to work.  Perhaps there is a different locale in effect?

Python 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:59) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 'あ'
>>> print(x)
あ
>>> print(ord(x))
12354
>>> import unicodedata
>>> unicodedata.name(x)
'HIRAGANA LETTER A'
>>> print('%x' % ord(x))
3042
>>> import locale
>>> locale.getlocale()
('en_US', 'UTF-8')
msg151053 - (view) Author: Atsushi Shibata (ats) Date: 2012-01-11 10:50
Thank you for testing on your environment :-).
I'll make sure the difference that caused the issue.

I changed the status to pending. I'll come back to this issue when I find the crue.

Thanks anyway !
msg166992 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2012-07-31 12:15
To reproduce this issue you could use the "Unicode Hex Input" input source (enable this in the Language & Text prefpane, switch between sources either using CMD-space or the menu bar icon).

I can "あ" by keeping ALT pressed and typing 3042.

This works fine with a self-built version of 3.2 (tip of tree), I haven't tested the 3.2 binary installer (yet).
msg269108 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2016-06-23 05:00
Ned, Closing as an out of date issue.
msg269172 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-06-24 14:03
This isn't out of date, it appears that it was not a bug in the first place, but the OP never got back to us with confirmation one way or the other.
msg269178 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2016-06-24 14:18
R. David, Fair enough. Thanks for pointing out the difference between 'out of date' and 'works for me'.
History
Date User Action Args
2016-06-24 14:18:38willingcsetmessages: + msg269178
2016-06-24 14:03:19r.david.murraysetresolution: out of date -> works for me

messages: + msg269172
nosy: + r.david.murray
2016-06-23 05:00:46willingcsetstatus: open -> closed

nosy: + willingc
messages: + msg269108

resolution: out of date
2012-07-31 12:15:27ronaldoussorensetstatus: pending -> open

messages: + msg166992
2012-01-11 10:50:11atssetstatus: open -> pending

messages: + msg151053
2012-01-11 09:17:36ned.deilysetmessages: + msg151046
2012-01-11 08:53:20atssetmessages: + msg151044
2012-01-11 08:11:45ned.deilysetnosy: + ned.deily
messages: + msg151040
2012-01-11 07:36:55atscreate