On 8/10/07, <b class="gmail_sendername">&quot;Martin v. Löwis&quot;</b> &lt;<a href="mailto:martin@v.loewis.de">martin@v.loewis.de</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;&gt;&gt; OTOH, IDLE ran w/o this error in p3yk...<br>&gt;&gt; Yes. Somebody would have to study what precisely the problem is: is it<br>&gt;&gt; that there is a None key in that dictionary, and that you must not use<br>
&gt;&gt; None as a tag name? In that case: where does the None come from?<br>&gt;&gt; Or else: is it that you can use None as a tagname in 2.x, but can&#39;t<br>&gt;&gt; anymore in 3.0? If so: why not?<br>&gt;<br>&gt; OK, I&#39;ll start looking at it. 
<br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">So did I, somewhat. It looks like a genuine bug in IDLE to me: you<br>can&#39;t use None as a tag name, AFAIU. I&#39;m not quite sure why this
<br>doesn&#39;t cause an exception in 2.x; if I try to give a None tag<br>separately (i.e. in a stand-alone program) in 2.5,<br>it gives me the same exception.</blockquote><div><br>In 2.x the &#39;tag configure None&#39; call does indeed raise a TclError, this can been seen by trapping calls to Tkinter_Error in _tkinter.c and outputting the Tkapp_Result.
<br><br>For some reason on py3k this TclError doesn&#39;t get caught anywhere, whilst in 2.x it either gets caught or just disappears. <br><br>This behaviour can be demonstrated with:<br><br></div>&nbsp;&nbsp;&nbsp; def config_colors(self):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for tag, cnf in self.tagdefs.items():<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if cnf:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.tag_configure(tag, **cnf)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sys.exit(1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
self.tag_raise(&#39;sel&#39;)<br><br>on py3k the exception is caught and execution stops<br>on 2.x no exception is caught and execution continues (however Tkinter_Error is still called during Tkiner_Call execution!?)<br><br>
tag_configure doesn&#39;t behave this way when used in a trivial stand-alone program, must be some obscurity within idle.<br><br>I&#39;m confused....<br><br>James<br></div><br>