[issue7768] raw_input should encode unicode prompt with std.stdout.encoding.

2010-01-23 Thread Naoki INADA
New submission from Naoki INADA songofaca...@gmail.com: raw_input and input should take unicode prompt and encode with sys.stdout.encoding like print or input in py3k. u = uあいう print u あいう x = raw_input(u) Traceback (most recent call last): File stdin, line 1, in module UnicodeEncodeError

[issue1754] WindowsError messages are not properly encoded

2010-01-14 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: I think WindowsError's message should be English like other errors. FormatMessageW() function can take dwLanguageId parameter. So I think Python should pass `MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)` to the parameter. -- nosy

[issue7072] isspace(0xa0) is true on Mac OS X

2009-10-06 Thread Naoki INADA
New submission from Naoki INADA songofaca...@gmail.com: Old FreeBSD's libc has a bug relate to utf-8 locale and Python have patch for it: http://svn.python.org/view/python/trunk/Include/pyport.h? view=diffpathrev=43219r1=36792r2=36793 This bug appears in Mac OS X again. This test fails: s

[issue5911] built-in compile() should take encoding option.

2009-10-03 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: add sample implementation. -- keywords: +patch Added file: http://bugs.python.org/file15030/compile_with_encoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5911

[issue6991] logging encoding failes some situation

2009-09-25 Thread Naoki INADA
Changes by Naoki INADA songofaca...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6991 ___ ___ Python-bugs-list

[issue6991] logging encoding failes some situation

2009-09-25 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: Please see and execute an attached foo.py. In Python 2.6.2, this cause following error: python foo.py Traceback (most recent call last): File foo.py, line 3, in module f.write('\xaa') File C:\usr\Python2.6\lib\codecs.py, line 686

[issue6991] logging encoding failes some situation

2009-09-24 Thread Naoki INADA
New submission from Naoki INADA songofaca...@gmail.com: When stream is codecs.writer object, stream.write(string) does string.decode() internally and it may cause UnicodeDecodeError. Then, fallback to utf-8 is not good. I think good fallback logic is: * When message is unicode, message.encode

[issue6991] logging encoding failes some situation

2009-09-24 Thread Naoki INADA
Changes by Naoki INADA songofaca...@gmail.com: -- versions: +Python 3.0, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6991

[issue6255] PyInt_FromSize_t is undocumented.

2009-06-10 Thread Naoki INADA
New submission from Naoki INADA songofaca...@gmail.com: PyInt_FromSize_t() is not in Python/C API document. People seeing document may be not able to find how to make int from unsigned long. -- assignee: georg.brandl components: Documentation messages: 89208 nosy: georg.brandl, naoki

[issue6255] PyInt_FromSize_t is undocumented.

2009-06-10 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: You're right. PyInt_FromSize_t() isn't safe for unsigned long. Maybe a PyInt_FromUnsignedLong method would be useful? It would be trivial to implement. I hope that all of py3k's PyInt_From** are in Python 2.x. It makes maintaining

[issue5911] built-in compile() should take encoding option.

2009-05-02 Thread Naoki INADA
New submission from Naoki INADA songofaca...@gmail.com: The built-in compile() expects source is encoded in utf-8. This behavior make it harder to implement alternative shell like IDLE and IPython. (http://bugs.python.org/issue1542677 and https://bugs.launchpad.net/ipython/+bug/339642

[issue1542677] IDLE shell gives different len() of unicode strings compared to Python shell

2009-04-12 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: utf-8 is not locale encoding. f = open('á.txt') If this line compiled into utf-8 and locale encoding is not utf-8, can't open 'á.txt'. IMHO, in case of Python 2.x, correct approach is fix IOBindings.encoding and compile() with pep0263

[issue1542677] IDLE shell gives different len() of unicode strings compared to Python shell

2009-04-12 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: How to use locale.getpreferredencoding() instead of locale.nl_langinfo(locale.CODESET). --- IOBinding.py.back Sun Apr 12 19:54:52 2009 +++ IOBinding.pySun Apr 12 20:02:58 2009 @@ -35,40 +35,16 @@ # Encoding for file names

[issue1542677] IDLE shell gives different len() of unicode strings compared to Python shell

2009-04-11 Thread Naoki INADA
Naoki INADA songofaca...@gmail.com added the comment: This patch is for iplib/PyShell.py#ModifiedInterpreter.runsource. if isinstance(source, types.UnicodeType): import IOBinding try: source = source.encode(IOBinding.encoding