Terry J. Reedy <[email protected]> added the comment:
On 3.2.2, Win7, the length is 2 and printing in Idle prints a square, as it
usually does for chars it cannot print. I presume Tk recognizes surrogate
pairs. Printing to the screen should not raise an exception, so the square
would be better. Even better would be to do what the 3.2 and 3.3 Command Prompt
Interpreters do, which is to print an evaluable representation:
>>> c
'\U00010330'
I assume that this string is produced by python.exe rather than Windows. If so,
neither of the two pythonw processes is currently doing the same conversion. My
understanding is that the user pythonw process uses idlelib.rpc.RPCproxy
objects to ship i/o calls to the idle pythonw process.
I presume we could find the idle process window .write methods and change lines
like
self.text.insert(mark, s, tags)
to
try:
self.text.insert(mark, s, tags)
except SomeTkError:
self.text.insert(mark, expand(s), tags)
But it seems to me that the expansion should really be done in C in _tkinter,
where the internal .kind attribute of strings is available.
---
There is also an input crash. On 3.2, I tried to cut the square char and paste
it into "ord('')" (both shell and edit window) to see what unicode char it is
and IDLE fades away as you describe. That puzzles me, as I am normally able to
paste BMP chars into idle without problem. In any case, I presume the problem
is not idle-specific and would best be handled in _tkinter. Or does the crash
happen in Windows or tcl/tk code before _tkinter ever sees the input?
When I paste the same into the 3.2 or 3.2 interpreter, it is converted to ascii
'?'. I presume this is done by Windows Command Prompt before sending anything
to python.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14200>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com