Skip to content

Truncated MemoryError exception message when importing too-large .py #569

@dhalbert

Description

@dhalbert

This is very odd:

  1. Get the .py version of the CPX library: https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground/releases/download/1.2.0/adafruit-circuitpython-circuitplayground-py-1.2.0.zip
  2. Unzip it and put the adafruit_circuitplayground directory at the top level of CIRCUITPY
  3. In the repl, try to import it. It's too big to compile, as expected. But note that the Memory Error: is incomplete.
Adafruit CircuitPython 2.2.1 on 2018-01-23; Adafruit CircuitPlayground Express with samd21g18
>>> from adafruit_circuitplayground.express import cpx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError: 
>>> 
  1. Now move the adafruit_circuitplayground directory into the lib directory, and restart the board.
  2. Import it again in the REPL:
Adafruit CircuitPython 2.2.1 on 2018-01-23; Adafruit CircuitPlayground Express with samd21g18
>>> from adafruit_circuitplayground.express import cpx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating 338 bytes

Note the differences in the exception message.

I've tried to make a simpler test case and haven't succeeded yet. T module's position on sys.path makes a difference. But it should not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy