python/mozbuild/mozbuild/controller/building.py uses hasattr("handler") but probably means "_handler", used elsewhere in file.
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox127 fixed)
| Tracking | Status | |
|---|---|---|
| firefox127 | --- | fixed |
People
(Reporter: jgilbert, Assigned: jgilbert)
Details
Attachments
(1 file)
/attr\(.*"handler"/:
https://searchfox.org/mozilla-central/search?q=attr%5C%28.*%22handler%22&path=&case=false®exp=true
Number of results: 2 (maximum is around 4000)
§ Core code (2 lines across 1 files)
▼ Textual Occurrences (2 lines across 1 files)
python/mozbuild/mozbuild/controller/building.py
681 have_handler = hasattr(self, "handler")
743 have_handler = hasattr(self, "handler")
[EOF]
/\._handler/:
https://searchfox.org/mozilla-central/search?q=%5C._handler&path=*py&case=true®exp=true
§ Core code (6 lines across 1 files)
▼ Textual Occurrences (6 lines across 1 files)
python/mozbuild/mozbuild/controller/building.py
627 self._handler = TerminalLoggingHandler()
628 self._handler.setFormatter(log_manager.terminal_formatter)
629 self._handler.footer = self.footer
631 old = log_manager.replace_terminal_handler(self._handler)
632 self._handler.level = old.level
641 self._handler.footer = None
§ Third-party code (11 lines across 4 files)
[...]
| Assignee | ||
Comment 1•1 year ago
|
||
Elsewhere in this file, we set ._handler, but never .handler. This
was probably missed in a refactor, possibly long ago. hasattr is
hazardous like this, so it would be even better not to use it, but we
can at least do the right thing the wrong way, rather than what seems to
be the wrong thing here before this change.
I was hoping that this might fix the ansi escape code corruption that
happens during builds for me, but it does not seem to.
Still, this seems like what was intended, so let's assert and try to
move forward.
Updated•1 year ago
|
Comment 3•1 year ago
|
||
| bugherder | ||
Description
•