[issue22214] Tkinter: Don't stringify callback arguments

Serhiy Storchaka report at bugs.python.org
Sun Jun 19 17:31:23 EDT 2016


Serhiy Storchaka added the comment:

Thank you Terry for your review. Here is updated patch fith fixed wording as you suggested. Hope it will be available to review on Rietveld.

The original purpose of this patch was to help fixing some IDLE "crashes". Percolator is registered in text widgets for highlighting pasted text. If you paste invalid string containing a lone surrogate on Windows (clipboard uses UTF-8), it first converted by Tcl to char*, and then Tkinter should convert it to Python string for passing to registered Python function, but fails. Since the information is lost during conversion in Tcl, we can't use say "surrogatepass" error handler fo representing non-well-formed data. With this patch we can decode just from Tcl unicode string.

----------
Added file: http://bugs.python.org/file43476/tkinter_obj_cmd_4.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22214>
_______________________________________


More information about the Python-bugs-list mailing list