py3 tkinter acceps bytes. why?

Terry Reedy tjreedy at udel.edu
Tue May 4 14:13:19 EDT 2010


On 5/4/2010 10:17 AM, Matthias Kievernagel wrote:
> From: Matthias Kievernagel<mkiever at Pirx.sirius.org>
> Subject: py3 tkinter acceps bytes. why?
> Newsgroups: comp.lang.python
> Summary:
> Keywords:
>
> In a recent thread named "py3 tkinter Text accepts what bytes?"
> (google groups link:
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/b75ed69f4e81b202/e2aff9ddd62d210c?lnk=raot)
> I asked what kinds of bytes are accepted as tkinter parameters.
> I still wonder why they are accepted at all.
> Does anyone know a reason for this
> or has a link to some relevant discussion?

I do not remember any particular public discussion of tkinter on the dev 
lists. I suspect the reason is a) avoid breaking old code and b) tkinter 
(tk inter-face) passes params on to tk which expects byte strings. I 
would not be surprised if tkinter has to encode py3 (unicode) strings 
before passing them on.

The Py3 changes were greatly complicated by the need to interface with 
the older bytes world.

Terry Jan Reedy




More information about the Python-list mailing list