Skip to content

Crash when assigning attribute before super().__init__() is called #1881

@tannewt

Description

@tannewt

From @nnja:

from adafruit_bitmap_font import bitmap_font
from adafruit_display_text.label import Label


class TextArea(Label):
    def __init__(self):
        self.x = 5  # what causes the PyPortal to boot in safe mode
        font = bitmap_font.load_font("/fonts/Helvetica-Bold-36.bdf")
        super().__init__(font, max_glyphs=3)


text = TextArea()

Comment out line 7 to stop the crash. I made a new class that inherits from Label. everything is fine until I try to set some instance variables on the child class. that's when the PyPortal goes into safe mode

anyway, I eventually figured out it's because of a conflict in what Label inherits from, http://displayio.Group -- but weird that there's no stack trace or anything. Just safe mode.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions