On 8/10/07, <b class="gmail_sendername">"Martin v. L÷wis"</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> 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;">
>>> OTOH, IDLE ran w/o this error in p3yk...<br>>> Yes. Somebody would have to study what precisely the problem is: is it<br>>> that there is a None key in that dictionary, and that you must not use<br>
>> None as a tag name? In that case: where does the None come from?<br>>> Or else: is it that you can use None as a tagname in 2.x, but can't<br>>> anymore in 3.0? If so: why not?<br>><br>> OK, I'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't use None as a tag name, AFAIU. I'm not quite sure why this
<br>doesn'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 'tag configure None' 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'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> def config_colors(self):
<br> for tag, cnf in self.tagdefs.items():<br> if cnf:<br> try:<br> self.tag_configure(tag, **cnf)<br> except:<br> sys.exit(1)<br>
self.tag_raise('sel')<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't behave this way when used in a trivial stand-alone program, must be some obscurity within idle.<br><br>I'm confused....<br><br>James<br></div><br>