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
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
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
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
Changes by Naoki INADA songofaca...@gmail.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6991
___
___
Python-bugs-list
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
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
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
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
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
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
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
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
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
14 matches
Mail list logo