<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/builtinimport.c, branch 6.0.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-08-30T16:09:49+00:00</updated>
<entry>
<title>builtinimport: Fix a crash with 'import ulab.linalg' on unix port only</title>
<updated>2020-08-30T16:09:49+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-08-30T16:09:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=455226ffded69538f5f453b566b499361b201ffb'/>
<id>urn:sha1:455226ffded69538f5f453b566b499361b201ffb</id>
<content type='text'>
A crash like the following occurs in the unix port:
```
Program received signal SIGSEGV, Segmentation fault.
0x00005555555a2d7a in mp_obj_module_set_globals (self_in=0x55555562c860 &lt;ulab_user_cmodule&gt;, globals=0x55555562c840 &lt;mp_module_ulab_globals&gt;) at ../../py/objmodule.c:145
145	    self-&gt;globals = globals;
(gdb) up
#1  0x00005555555b2781 in mp_builtin___import__ (n_args=5, args=0x7fffffffdbb0) at ../../py/builtinimport.c:496
496	                mp_obj_module_set_globals(outer_module_obj,
(gdb)
#2  0x00005555555940c9 in mp_import_name (name=824, fromlist=0x555555621f10 &lt;mp_const_none_obj&gt;, level=0x1) at ../../py/runtime.c:1392
1392	    return mp_builtin___import__(5, args);
```

I don't understand how it doesn't happen on the embedded ports, because
the module object should reside in ROM and the assignment of self-&gt;globals
should trigger a Hard Fault.

By checking VERIFY_PTR, we know that the pointed-to data is on the heap
so we can do things like mutate it.
</content>
</entry>
<entry>
<title>Add license to some obvious files.</title>
<updated>2020-07-06T18:16:25+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-06-03T22:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=34b4993d63a6b576f29d624385c681f679b4124c'/>
<id>urn:sha1:34b4993d63a6b576f29d624385c681f679b4124c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Validate builtin member is a module</title>
<updated>2020-02-26T18:32:02+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-02-26T18:32:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6375d8699e84ffab0754af58c311bf869ad648ab'/>
<id>urn:sha1:6375d8699e84ffab0754af58c311bf869ad648ab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support importing native modules in native packages.</title>
<updated>2020-02-25T23:32:55+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2020-02-25T20:13:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=86fd93bd03d937713d4d23fa38ab359034c503c2'/>
<id>urn:sha1:86fd93bd03d937713d4d23fa38ab359034c503c2</id>
<content type='text'>
This only fixes the `import` portion. It doesn't actually change
reference behavior because modules within a package could already
be referenced through the parent package even though an error should
have been thrown.
</content>
</entry>
<entry>
<title>modsys: exc_info: Add traceback</title>
<updated>2018-10-07T17:37:49+00:00</updated>
<author>
<name>Noralf Trønnes</name>
<email>noralf@tronnes.org</email>
</author>
<published>2018-09-06T21:07:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=db4a8f5d1a4d26b36d58ab2017501f63bd1cbe03'/>
<id>urn:sha1:db4a8f5d1a4d26b36d58ab2017501f63bd1cbe03</id>
<content type='text'>
Add traceback chain to sys.exec_info()[2].
No actual frame info is added, but just enough to recreate the printed
exception traceback.

Used by the unittest module which collects errors and failures and prints
them at the end.
</content>
</entry>
<entry>
<title>py/builtinimport: Set __file__ on MPY modules</title>
<updated>2018-10-07T17:36:12+00:00</updated>
<author>
<name>Noralf Trønnes</name>
<email>noralf@tronnes.org</email>
</author>
<published>2018-10-07T13:37:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a63555abc1ce07fe4e9420b5835865282adcd1db'/>
<id>urn:sha1:a63555abc1ce07fe4e9420b5835865282adcd1db</id>
<content type='text'>
This sets the __file__ property on MPY modules like how it's done on pure python modules.
</content>
</entry>
<entry>
<title>Two fixes and translate more strings.</title>
<updated>2018-08-09T20:29:30+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-09T01:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96ebf5bc3fb455162286b9bc31e763f3c4f1c457'/>
<id>urn:sha1:96ebf5bc3fb455162286b9bc31e763f3c4f1c457</id>
<content type='text'>
* Fix finding translations with escaped characters.
* Add back \r to translations since its needed by screen.
</content>
</entry>
<entry>
<title>WIP: after merge; before testing</title>
<updated>2018-07-11T20:45:30+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-07-11T20:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7c219600a246d8956d0b23ea3f5d125a820e6b6a'/>
<id>urn:sha1:7c219600a246d8956d0b23ea3f5d125a820e6b6a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Always collect after an import</title>
<updated>2018-07-03T12:45:50+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-06-28T17:39:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9de611c056e06684dfa9e5fb4c5fd2f4df579046'/>
<id>urn:sha1:9de611c056e06684dfa9e5fb4c5fd2f4df579046</id>
<content type='text'>
Imports generate a lot of garbage so cleaning it up immediately
reduces the likelihood longer lived data structures don't end up in
the middle of the heap.

Fixes #856
</content>
</entry>
<entry>
<title>py/builtinimport: Add compile-time option to disable external imports.</title>
<updated>2018-02-20T07:00:44+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-02-20T07:00:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=209936880df4d63730ea77cf4b6f84e5f2f56d7c'/>
<id>urn:sha1:209936880df4d63730ea77cf4b6f84e5f2f56d7c</id>
<content type='text'>
The new option is MICROPY_ENABLE_EXTERNAL_IMPORT and is enabled by default
so that the default behaviour is the same as before.  With it disabled
import is only supported for built-in modules, not for external files nor
frozen modules.  This allows to support targets that have no filesystem of
any kind and that only have access to pre-supplied built-in modules
implemented natively.
</content>
</entry>
</feed>
