| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
This prevents large files (eg larger than 2gb on a 32-bit arch) from
showing up as having a negative size. Fixes issue #3227.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Behaviour is as per CPython but only the binary form is implemented here.
A test is included.
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
"STATIC inline" can expand to "inline" if STATIC is defined to nothing, and
this case can lead to link errors.
|
|
|
|
| |
Allows to join multicast groups.
|
|
|
|
|
| |
There were several different spellings of MicroPython present in comments,
when there should be only one.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Thanks to @kamikaze, aka Oleg Korsak, for the original idea and patch.
|
|
|
|
| |
Also, use mp_stream_close() helper to close the underlying socket.
|
|
|
|
|
|
| |
Since the stride is specified in pixels, in a 4-bit horizontal format it
has to always be even, otherwise the computation is wrong and we can
write outside of the buffer sometimes.
|
|
|
|
|
| |
If this particular code is returned then there's no more data, it's not
really an error.
|
| |
|
|
|
|
|
| |
To use server_side mode one must pass valid values in the "key" and "cert"
parameters.
|
|
|
|
|
| |
Make sure that 2nd close has no effect and operations on closed streams
are handled properly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.
This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.
The rules are as follows.
Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _
In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.
py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
|
| |
|
| |
|
|
|
|
|
| |
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.
|
|
|
|
| |
n_args is now actually used in this function.
|
|
|
|
| |
This follows naming scheme of other modules in extmod.
|
|
|
|
| |
It's now generic enough to be used by any port.
|
| |
|
|
|
|
| |
As enabled by SNI support in axTLS v2+.
|
|
|
|
| |
ssl_client_new() accepts new SSL_EXTENSIONS* argument.
|
|
|
|
| |
Happened with 32-bit gcc 4.8.4.
|
|
|
|
|
| |
These args are currently ignored but are parsed to make it easier to
write portable scripts between CPython and MicroPython.
|
| |
|
|
|
|
|
| |
In non-blocking mode, if no pending connection available, should return
EAGAIN, not ETIMEDOUT.
|
|
|
|
|
|
|
|
| |
If socket is already connected, POSIX requires returning EISCONN. If
connection was requested, but not yet complete (for non-blocking
socket), error code is EALREADY.
http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
|
|
|
|
|
| |
Instead of ETIMEDOUT. This is consistent with POSIX:
http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
VfsFat no longer has the listdir() method. Rather, if listdir()
functionality is needed then one should use uos.listdir() which will call
VfsFat.ilistdir().
|
|
|
|
|
| |
uos.ilistdir() is the core function, returning an iterator that yields
3-tuples. uos.listdir() is implemented in terms of ilistdir().
|
|
|
|
|
|
|
| |
This patch allows mounting of VFS objects right at the root directory, eg
os.mount(vfs, '/'). It still allows VFS's to be mounted at a path within
the root, eg os.mount(vfs, '/flash'), and such mount points will override
any paths within a VFS that is mounted at the root.
|
|
|
|
|
|
|
|
|
|
| |
Peer-closed socket is both readable and writable: read will return EOF,
write - error. Without this poll will hang on such socket.
Note that we don't return POLLHUP, based on argumentation in
http://www.greenend.org.uk/rjk/tech/poll.html that it should apply to
deeper disconnects, for example for networking, that would be link layer
disconnect (e.g. WiFi went down).
|
|
|
|
| |
But warn if anything else but host/port is passed.
|
|
|
|
| |
Similar to the implementation added to unix port module previously.
|
|
|
|
| |
This follows previous refactor made to unix/moduselect.
|
| |
|
| |
|