micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

ffilib:fix Traceback in Unix port due to missing 'maxsize'

Open pvinci opened this issue 5 years ago • 1 comments

from machine import I2C Traceback (most recent call last): File "", line 1, in File "/root/.micropython/lib/machine/init.py", line 2, in File "/root/.micropython/lib/machine/timer.py", line 1, in File "/root/.micropython/lib/ffilib.py", line 43, in AttributeError: 'module' object has no attribute 'maxsize'

pvinci avatar Sep 30 '20 23:09 pvinci

I think the issue here is that micropython-lib's sys module needs to be updated since https://github.com/micropython/micropython/pull/6164 renamed the builtin from sys to usys.

So what used to happen is that import sys got the builtin, whereas since https://github.com/micropython/micropython/pull/6164 it now gets micropython-lib's empty sys.py

The fix is that sys.py should "inherit" from usys by having from usys import * at the start. This is what's done for other modules. Are you able to test that and see if it resolves the issue?

The other fix is that micropython-lib shouldn't contain these empty placeholder modules.... see #376 for some thoughts on that.

jimmo avatar Oct 01 '20 00:10 jimmo