Tom Collins
168350cd98
py/objstringio: Prevent offset wraparound for io.BytesIO objects.
Too big positive, or too big negative offset values could lead to overflow
and address space wraparound and thus access to unrelated areas of memory
(a security issue).
8 years ago
Paul Sokolovsky
387a8d26f9
docs/glossary: Fix typos in micropython-lib paragraph.
7 years ago
Paul Sokolovsky
46583e9057
docs/glossary: Elaborate on possible MicroPython port differences.
State that this doc describes generic, "core" MicroPython functionality,
any particular port may diverge in both directions, by both omitting
some functionality, and adding more, both cases described outside the
generic documentation.
7 years ago
Paul Sokolovsky
3f91570483
docs/library/usocket: Describe complete information on address formats.
Describe that the only portable way to deal with addresses is by using
getaddrinfo(). Describe that some ports may support tuple addresses using
"socket" module (vs "usocket" of native MicroPython).
7 years ago
Paul Sokolovsky
ccaad53270
docs/library/usocket: Move socket.error to its own section.
It's too minor a point to start the module description with it.
7 years ago
Paul Sokolovsky
478887c62f
zephyr/modzephyr: Add shell_net_iface() function.
Calls out to Zephyr's shell, submodule "net", command "iface", and shows
network interface information (if CONFIG_NET_SHELL is enabled).
7 years ago
Paul Sokolovsky
394c536675
zephyr/prj_96b_carbon.conf: Re-enable networking on Carbon.
The original issue leading to crash on startup if no default network
interface was presented, was resolved some time ago.
Note that this enables generic networking subsystem, not networking
on Carbon.
7 years ago
Paul Sokolovsky
09b561f108
zephyr/modusocket: Update struct sockaddr family field name.
Was changed to "sa_family" for POSIX compatibility.
7 years ago
Alex Robbins
0aa1d3f447
docs/library/ubinascii: Update base64 docs.
This clarifies return values and the handling of invalid (e.g. newline)
characters.
Encoding conforms to RFC 3548, but decoding does not, as it ignores invalid
characters in base64 input. Instead, it conforms to MIME handling of base64
(RFC 2045).
Note that CPython doesn't document handling of invalid characters in
a2b_base64() docs:
https://docs.python.org/3/library/binascii.html#binascii.a2b_base64 , so
we specify it more explicitly than it, based on CPython's actual behavior
(with which MicroPython now compliant).
7 years ago
Alex Robbins
c89254fd0f
extmod/modubinascii: Rewrite mod_binascii_a2b_base64.
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.
7 years ago
Damien George
025e5f2b33
py/binary: Change internal bytearray typecode from 0 to 1.
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.
7 years ago
stijn
e4ab404780
tools/mpy-tool.py: Fix missing argument in dump() function
This makes the -d commandline argument usable again.
Pass empty string as parent name as listing starts from the root.
7 years ago
Paul Sokolovsky
9404093606
zephyr/prj_base.conf: Enable CONFIG_INIT_STACKS.
As required for zephyr.stack_analyze().
7 years ago
Paul Sokolovsky
ad937c49aa
zephyr/modzephyr: Add current_tid() and stacks_analyze() functions.
current_tid() returns current thread ID. stacks_analyze() calls
k_call_stacks_analyze() which, with CONFIG_INIT_STACKS enabled,
will print stack usage for some well-known threads in the system.
7 years ago
Eric Poulsen
d5191edf7f
extmod/modussl_mbedtls.c: Add ussl.getpeercert() method.
Behaviour is as per CPython but only the binary form is implemented here.
A test is included.
7 years ago
Stefan Naumann
ace9fb5405
py: Add verbose debug compile-time flag MICROPY_DEBUG_VERBOSE.
It enables all the DEBUG_printf outputs in the py/ source code.
7 years ago
Bas van Sisseren
a14ce77b28
py/binary.c: Fix bug when packing big-endian 'Q' values.
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'
7 years ago
Javier Candeira
c127ace28a
docs/library/machine.RTC.rst: Fix typo.
7 years ago
Javier Candeira
35a1fea90b
all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError
- OSError invocations unchanged, because the corresponding utility
function takes ints, not strings like the long form invocation.
- OverflowError, IndexError and RuntimeError etc. not changed for now
until we decide whether to add new utility functions.
7 years ago
Damien George
b6a3289564
tools/mpy-tool.py: Don't generate const_table if it's empty.
7 years ago
Paul Sokolovsky
bfc2092dc5
py/modsys: Initial implementation of sys.getsizeof().
Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and
instances.
7 years ago
Damien George
7d4a2f773c
all: Make use of $(TOP) variable in Makefiles, instead of "..".
$(TOP) is defined in py/mkenv.mk and should be used to refer to the top
level of this repository.
7 years ago
Damien George
f9dfd8aa3b
minimal,esp8266,pic16bit: Remove unused stmhal include from Makefile.
7 years ago
Paul Sokolovsky
63edc2e78b
zephyr/modusocket: Fully switch to native Zephyr sockets.
7 years ago
Damien George
3d25d9c7d9
py/objstr: Raise an exception for wrong type on RHS of str binary op.
The main case to catch is invalid types for the containment operator, of
the form str.__contains__(non-str).
7 years ago
Damien George
eb2784e8a2
py/objtuple: Allow to use inplace-multiplication operator on tuples.
7 years ago
Paul Sokolovsky
cb7ecda9f0
zephyr/modusocket: recv: Switch to native sockets.
7 years ago
Paul Sokolovsky
675ceb2dd9
zephyr/modusocket: send: Switch to native sockets.
7 years ago
Paul Sokolovsky
600f5afed3
zephyr/modusocket: bind, connect, listen, accept: Swtich to native sockets.
7 years ago
Paul Sokolovsky
6c55cdafa3
zephyr/modusocket: socket, close: Switch to native Zephyr socket calls.
7 years ago
Paul Sokolovsky
642d9fd2a5
zephyr/modusocket: Allow to use socketized net_context in upstream.
Accesses recv_q, accept_q directly in net_context.
7 years ago
Paul Sokolovsky
4dc7c5649b
py/mkrules.mk: Show frozen modules sizes together with executable size.
This works for Unix and similar ports so far.
7 years ago
Paul Sokolovsky
ca582675e1
zephyr/Makefile: Explicitly define default target as "all".
For some reason, with the latest Zephyr master, running just "make" led
to executing Zephyr's "qemu" target.
7 years ago
Damien George
0f12082f5b
py,extmod,stmhal: Use "static inline" for funcs that should be inline.
"STATIC inline" can expand to "inline" if STATIC is defined to nothing, and
this case can lead to link errors.
7 years ago
Paul Sokolovsky
ee04525097
extmod/modlwip: Implement setsockopt(IP_ADD_MEMBERSHIP).
Allows to join multicast groups.
7 years ago
Alexander Steffen
55f33240f3
all: Use the name MicroPython consistently in comments
There were several different spellings of MicroPython present in comments,
when there should be only one.
7 years ago
Damien George
bbced3b4bb
extmod: Use MP_ROM_INT for int values in an mp_rom_map_elem_t.
7 years ago
Damien George
b62bb53d0e
py/modsys: Use MP_ROM_INT for int values in an mp_rom_map_elem_t.
7 years ago
Paul Sokolovsky
e6bb25317b
esp8266: Convert to mp_rom_map_elem_t.
7 years ago
Paul Sokolovsky
e3864b5907
esp8266/modesp: Remove unused constants: STA_MODE, etc.
WiFi mode selection happens on the level of individual interfaces.
7 years ago
Paul Sokolovsky
e280122b14
unix/modjni: Convert to mp_rom_map_elem_t.
7 years ago
Paul Sokolovsky
f2140f9446
extmod/mod{lwip,onewire,webrepl}: Convert to mp_rom_map_elem_t.
7 years ago
Paul Sokolovsky
036b58228c
extmod/modframebuf: Use correct initialization for .locals_dict.
7 years ago
Paul Sokolovsky
456450437f
py/modio: BufferedWriter: Convert to mp_rom_map_elem_t.
7 years ago
Paul Sokolovsky
f578947ae3
.travis.yml: Pin cpp-coveralls at 0.3.12.
Next version, 0.4.0 appears to depend on newer version of urllib3 and
conflicts with version installed in Travis.
7 years ago
Paul Sokolovsky
a3cd349eaf
tools/mpy_bin2res: Tools to convert binary resources to Python module.
Afterwards, they can be access using pkg_resource module from
micropython-lib.
7 years ago
Damien George
653a0c2d71
extmod/machine_signal: Fix parsing of invert arg when Pin is first arg.
7 years ago
Eric Poulsen
6b4d4a25ce
extmod/modussl_mbedtls: Implement non-blocking SSL sockets.
7 years ago
Damien George
f3687109d5
extmod/modframebuf: Consistently use "col" as name for colour variables.
Thanks to @kamikaze , aka Oleg Korsak, for the original idea and patch.
7 years ago
Damien George
0893b273b9
extmod/modussl_mbedtls: Make socket.close() free all TLS resources.
Also, use mp_stream_close() helper to close the underlying socket.
7 years ago