New submission from Jim Jewett <[EMAIL PROTECTED]>: The str->Unicode change widened IDLE/batch discrepancy.
In python 2.x, bytes are printable. >>> for i in range(256): print i, chr(i) works fine. In python 3, chr has become (the old) unichr, and whether a unicode character is printable depends on the environment. In particular, under my Windows XP, the equivalent >>> for i in range(256): print (i, chr(i)) will still work fine under IDLE, but will now crash with an UnicodeEncodeError when run from the command line. ---------------- Unfortunately, I'm not sure what the right solution actually is, other than a mention in the Whats New document. I believe the 2.5 code was using a system page to print those characters, as they often looked like letters rather than <control>. Copying that would probably be the wrong solution. Limiting IDLE would add consistency, but might be a lot of work for the equivalent of a --pedantic flag. PEP 3138 seems to be proposing a default stdout BackslashReplace, which may at least help. ---------- assignee: georg.brandl components: Documentation, Unicode messages: 67617 nosy: georg.brandl, jimjjewett severity: normal status: open title: batch/IDLE differ: print broken for chraracters>ascii type: behavior versions: Python 3.0 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3025> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com