<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod/moduzlib.c, branch 6.1.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-11-19T22:15:06+00:00</updated>
<entry>
<title>Introduce, use mp_raise_arg1</title>
<updated>2020-11-19T22:15:06+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-11-19T22:13:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c06fc8e02dc7c17e827e3fe736dc7226d7819452'/>
<id>urn:sha1:c06fc8e02dc7c17e827e3fe736dc7226d7819452</id>
<content type='text'>
This raises an exception with a given object value.  Saves a bit of
code size.
</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>protocols: Allow them to be (optionally) type-safe</title>
<updated>2019-12-04T15:29:57+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-03T20:50:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=238e12123690debaf2cf8488fb2a4d4003a06506'/>
<id>urn:sha1:238e12123690debaf2cf8488fb2a4d4003a06506</id>
<content type='text'>
Protocols are nice, but there is no way for C code to verify whether
a type's "protocol" structure actually implements some particular
protocol.  As a result, you can pass an object that implements the
"vfs" protocol to one that expects the "stream" protocol, and the
opposite of awesomeness ensues.

This patch adds an OPTIONAL (but enabled by default) protocol identifier
as the first member of any protocol structure.  This identifier is
simply a unique QSTR chosen by the protocol designer and used by each
protocol implementer.  When checking for protocol support, instead of
just checking whether the object's type has a non-NULL protocol field,
use `mp_proto_get` which implements the protocol check when possible.

The existing protocols are now named:
    protocol_framebuf
    protocol_i2c
    protocol_pin
    protocol_stream
    protocol_spi
    protocol_vfs
(most of these are unused in CP and are just inherited from MP; vfs and
stream are definitely used though)

I did not find any crashing examples, but here's one to give a flavor of what
is improved, using `micropython_coverage`.  Before the change,
the vfs "ioctl" protocol is invoked, and the result is not intelligible
as json (but it could have resulted in a hard fault, potentially):

    &gt;&gt;&gt; import uos, ujson
    &gt;&gt;&gt; u = uos.VfsPosix('/tmp')
    &gt;&gt;&gt; ujson.load(u)
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    ValueError: syntax error in JSON

After the change, the vfs object is correctly detected as not supporting
the stream protocol:
    &gt;&gt;&gt; ujson.load(p)
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    OSError: stream operation not supported
</content>
</entry>
<entry>
<title>More make_new fixes for unix build</title>
<updated>2019-01-18T19:53:09+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-01-18T19:53:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0318a9a9bcbceab308323788cb9e579da166710e'/>
<id>urn:sha1:0318a9a9bcbceab308323788cb9e579da166710e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>uzlib: Upgrade to uzlib v2.9 release</title>
<updated>2018-09-10T01:22:25+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2018-09-10T01:22:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=014857b34b3fe9006a8d65586a6046bf474d358a'/>
<id>urn:sha1:014857b34b3fe9006a8d65586a6046bf474d358a</id>
<content type='text'>
This fixes a large number of crashes on malformed inputs.
</content>
</entry>
<entry>
<title>Fix esp and samd</title>
<updated>2018-08-17T00:41:35+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-16T20:34:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2cd166b57370ab4877ec2d9666225faeac6127ce'/>
<id>urn:sha1:2cd166b57370ab4877ec2d9666225faeac6127ce</id>
<content type='text'>
</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>extmod: Update to use new mp_get_stream helper.</title>
<updated>2018-06-18T02:35:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-06-13T02:37:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e8398a58567cc94b866d46721fd06289601f5c8a'/>
<id>urn:sha1:e8398a58567cc94b866d46721fd06289601f5c8a</id>
<content type='text'>
With this patch objects are only checked that they have the stream protocol
at the start of their use as a stream, and afterwards the efficient
mp_get_stream() helper is used to extract the stream protocol C methods.
</content>
</entry>
<entry>
<title>uzlib: convert to submodule</title>
<updated>2018-05-08T01:03:30+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2018-05-08T01:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a6072f7ae356f3e6c8100a78a2ae3bb976382a20'/>
<id>urn:sha1:a6072f7ae356f3e6c8100a78a2ae3bb976382a20</id>
<content type='text'>
Textualy, the files in lib/uzlib/src were identical to the ones committed
in extmod/uzlib so there should be no behavioral change possible as a
result of this commit.
</content>
</entry>
<entry>
<title>all: Remove inclusion of internal py header files.</title>
<updated>2017-10-04T01:37:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-04T01:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a3dc1b1957d2c96d7c60c2c629c95077b03488a1'/>
<id>urn:sha1:a3dc1b1957d2c96d7c60c2c629c95077b03488a1</id>
<content type='text'>
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
</content>
</entry>
</feed>
