| Age | Commit message (Collapse) | Author |
|
development) master.
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
|
|
access. (#203)
* atmel-samd: Introduce a nvm module for non-volatile byte-level memory access.
This allows for persisting small configuration values even when the file system
is read-only from CircuitPython.
Fixes #160
* Review feedback:
* Add tests.
* Fix non-zero index.
* Fix len()
|
|
Per POSIX, this is EINVAL, so raises OSError(EINVAL).
|
|
This implementation ignores invalid characters in the input. This allows
it to decode the output of b2a_base64, and also mimics the behavior of
CPython.
|
|
The value of 0 can't be used because otherwise mp_binary_get_size will let
a null byte through as the type code (intepreted as byterray). This can
lead to invalid type-specifier strings being let through without an error
in the struct module, and even buffer overruns.
|
|
Behaviour is as per CPython but only the binary form is implemented here.
A test is included.
|
|
Without bugfix:
struct.pack('>Q', 16)
b'\x00\x00\x00\x10\x00\x00\x00\x00'
With bugfix:
struct.pack('>Q', 16)
b'\x00\x00\x00\x00\x00\x00\x00\x10'
|
|
This introduces a skip_if module that can be used by tests to
determine when they should be skipped due to the environment.
Some tests have been split in order to have finer grained skip
control.
|
|
Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and
instances.
|
|
The main case to catch is invalid types for the containment operator, of
the form str.__contains__(non-str).
|
|
|
|
There were several different spellings of MicroPython present in comments,
when there should be only one.
|
|
Before this patch raising a big-int to a negative power would just return
0. Now it returns a floating-point number with the correct value.
|
|
|
|
|
|
Make sure that 2nd close has no effect and operations on closed streams
are handled properly.
|
|
|
|
|
|
|
|
|
|
This is the last "orphan" case.
|
|
|
|
Adds nothing to the code size, since it uses existing empty slots in the
type structures.
|
|
|
|
|
|
|
|
Previous to this patch hexlify(b'', b':') would lead to a bad crash due to
the computed length of the result being -1=0xffffffff.
|
|
This applies to match.group() and split().
For ARM Thumb2, this increased code size by 12 bytes.
|
|
|
|
|
|
|
|
|
|
The floating-point precision of the target is detected (0, 30, 32 or 64)
and only those tests which can run on the target will be run.
|
|
In the future, a special runner for such tests will import each test and
call test() function with an address of test server to use.
|
|
The idea is that these tests can be run with just a test server running
on a test host, with device under test connecting to it, instead of
requiring Internet connection for testing.
Such setup is however WIP, and some tests in net_hosted/ are so far
written to connect to Internet, as there're not test server written
yet. This is expected to evolve over time.
|
|
|
|
Some of these tests don't require an Internet connection, but here is a
good place to put them for now.
|
|
This attempts to bootstrap network tests for MicroPython. This commits
sets test/net_inet/ as place for tests which require access to wide
Internet. They aren't intended to be run as part of the main testsuite,
instead to be run manually on demand.
test_tls_sites.py in particular check that it's possible to establish
SSL/TLS connection to select sites on the Internet: few references ones,
plus those for which problems were reported, and resolved.
|
|
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions
This release provides an important fix for the USB mass storage device in
the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which
is now require by some Operating Systems. There are also fixes for the
lwIP bindings to improve non-blocking sockets and error codes. The VFS has
some regressions fixed including the ability to statvfs the root.
All changes are listed below.
py core:
- modbuiltins: add core-provided version of input() function
- objstr: catch case of negative "maxsplit" arg to str.rsplit()
- persistentcode: allow to compile with complex numbers disabled
- objstr: allow to compile with obj-repr D, and unicode disabled
- modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled
- provide mp_decode_uint_skip() to help reduce stack usage
- makeqstrdefs.py: make script run correctly with Python 2.6
- objstringio: if created from immutable object, follow copy on write policy
extmod:
- modlwip: connect: for non-blocking mode, return EINPROGRESS
- modlwip: fix error codes for duplicate calls to connect()
- modlwip: accept: fix error code for non-blocking mode
- vfs: allow to statvfs the root directory
- vfs: allow "buffering" and "encoding" args to VFS's open()
- modframebuf: fix signed/unsigned comparison pendantic warning
lib:
- libm: use isfinite instead of finitef, for C99 compatibility
- utils/interrupt_char: remove support for KBD_EXCEPTION disabled
tests:
- basics/string_rsplit: add tests for negative "maxsplit" argument
- float: convert "sys.exit()" to "raise SystemExit"
- float/builtin_float_minmax: PEP8 fixes
- basics: convert "sys.exit()" to "raise SystemExit"
- convert remaining "sys.exit()" to "raise SystemExit"
unix port:
- convert to use core-provided version of built-in import()
- Makefile: replace references to make with $(MAKE)
windows port:
- convert to use core-provided version of built-in import()
qemu-arm port:
- Makefile: adjust object-file lists to get correct dependencies
- enable micropython.mem_*() functions to allow more tests
stmhal port:
- boards: enable DAC for NUCLEO_F767ZI board
- add support for NUCLEO_F446RE board
- pass USB handler as parameter to allow more than one USB handler
- usb: use local USB handler variable in Start-of-Frame handler
- usb: make state for USB device private to top-level USB driver
- usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command
- convert from using stmhal's input() to core provided version
cc3200 port:
- convert from using stmhal's input() to core provided version
teensy port:
- convert from using stmhal's input() to core provided version
esp8266 port:
- Makefile: replace references to make with $(MAKE)
- Makefile: add clean-modules target
- convert from using stmhal's input() to core provided version
zephyr port:
- modusocket: getaddrinfo: Fix mp_obj_len() usage
- define MICROPY_PY_SYS_PLATFORM (to "zephyr")
- machine_pin: use native Zephyr types for Zephyr API calls
docs:
- machine.Pin: remove out_value() method
- machine.Pin: add on() and off() methods
- esp8266: consistently replace Pin.high/low methods with .on/off
- esp8266/quickref: polish Pin.on()/off() examples
- network: move confusingly-named cc3200 Server class to its reference
- uos: deconditionalize, remove minor port-specific details
- uos: move cc3200 port legacy VFS mounting functions to its ref doc
- machine: sort machine classes in logical order, not alphabetically
- network: first step to describe standard network class interface
examples:
- embedding: use core-provided KeyboardInterrupt object
|
|
|
|
|
|
In CPython 3.4 this raises a SyntaxError. In CPython 3.5+ having a
positional after * is allowed but uPy has the wrong semantics and passes
the arguments in the incorrect order. To prevent incorrect use of a
function going unnoticed it is important to raise the SyntaxError in uPy,
until the behaviour is fixed to follow CPython 3.5+.
|
|
|
|
This patch fixes 2 things when printing a floating-point number that
requires rounding up of the mantissa:
- retain the correct precision; eg 0.99 becomes 1.0, not 1.00
- if the exponent goes from -1 to 0 then render it as +0, not -0
|
|
|
|
|
|
|
|
Don't create copy of immutable object's contents until .write() is called
on BytesIO.
|
|
|
|
The latter is shorter and simpler because it doesn't require importing the
sys module.
|