Comment 4 for bug 243785

Revision history for this message
Marius Gedminas (mgedmin) wrote :

The _end_label that is called too early is caused by this:

    def start_label(self, attrs):
        ...
        taken = bool(d.get("for"))
        d["__taken"] = taken

and this

    def _add_label(self, d):
        ...
            if self._current_label["__taken"]:
                self.end_label() # be fuzzy

_add_label is called from do_input(). The label gets correctly attached to the input, but the label text remains empty due to the premature end_label() call.