Latest trunk.
root@OpenWrt:~# micropython
MicroPython d5d146f on 2015-12-30; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
import os
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/micropython/os/__init__.py", line 22, in <module>
OSError: 2
Relevant code in micropython-lib (os/__init__.py):
libc = ffilib.libc()
try:
errno__ = libc.var("i", "errno")
def errno_(val=None):
if val is None:
return errno__.get()
errno__.set(val)
except OSError:
__errno = libc.func("p", "__errno", "")
def errno_(val=None):
if val is None:
p = __errno()
buf = ffi.as_bytearray(p, 4)
return int.from_bytes(buf)
raise NotImplementedError
It's still usable, but the 'os' library is essential, much of micropython-lib can't be used as a result, not to mention 'os' itself.
The error is specifically being thrown on the line '__errno = libc.func("p", "__errno", "")'.
(Last edited by ktennozu on 30 Dec 2015, 15:49)