summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31572: Silence only AttributeError when get the __copy__ attribute in ↵Serhiy Storchaka2017-11-111-7/+25
| | | | itertools.tee(). (#3724)
* Add the const qualifier to "char *" variables that refer to literal strings. ↵Serhiy Storchaka2017-11-1110-14/+15
| | | | (#4370)
* bpo-31976: Fix race condition when flushing a file is slow. (#4331)benfogle2017-11-101-5/+9
|
* bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (#4235)Serhiy Storchaka2017-11-092-65/+71
| | | | | | | * Fix compilation of the socket module on NetBSD 8. * Fix the assertion failure or reading arbitrary data when parse a AF_BLUETOOTH address on NetBSD and DragonFly BSD. * Fix other potential errors and make the code more reliable.
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-086-8/+8
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* bpo-11063: Add a configure check for uuid_generate_time_safe (GH-4287)Berker Peksag2017-11-081-9/+2
|
* bpo-31884 subprocess: add Windows constants for process priority (#4150)James2017-11-081-0/+12
|
* Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093)Justus Schwabedal2017-11-071-0/+1
|
* bpo-31843: sqlite3.connect() now accepts PathLike objects as database name ↵Anders Lorentsen2017-11-072-4/+9
| | | | (#4299)
* bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor ↵Oren Milman2017-11-071-0/+5
| | | | object is uninitialized (#3958)
* bpo-31770: Prevent a crash and refleaks when calling ↵Oren Milman2017-11-071-8/+7
| | | | sqlite3.Cursor.__init__() more than once (#3968)
* Fix miscellaneous typos (#4275)luzpaz2017-11-057-13/+13
|
* bpo-31933: fix blake2 multi-byte params on big endian platforms (#4250)Jack O'Connor2017-11-032-4/+8
| | | | | | | | | | | | All Blake2 params have to be encoded in little-endian byte order. For the two multi-byte integer params, leaf_length and node_offset, that means that assigning a native-endian integer to them appears to work on little-endian platforms, but gives the wrong result on big-endian. The current libb2 API doesn't make that very clear, and @sneves is working on new API functions in the GH issue above. In the meantime, we can work around the problem by explicitly assigning little-endian values to the parameter block. See https://github.com/BLAKE2/libb2/issues/12.
* bpo-30057: Fix potential missed signal in signal.signal(). (#4258)Antoine Pitrou2017-11-031-1/+4
| | | Bug report and patch by Jeroen Demeyer.
* bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)Tal Einat2017-11-032-5/+5
| | | | | | | | | When a single .c file contains several functions and/or methods with the same name, a safety _METHODDEF #define statement is generated only for one of them. This fixes the bug by using the full name of the function to avoid duplicates rather than just the name.
* bpo-31784: Implement PEP 564: add time.time_ns() (#3989)Victor Stinner2017-11-022-138/+349
| | | | | | | | | | | | | | | | | | | | | | | | | Add new time functions: * time.clock_gettime_ns() * time.clock_settime_ns() * time.monotonic_ns() * time.perf_counter_ns() * time.process_time_ns() * time.time_ns() Add new _PyTime functions: * _PyTime_FromTimespec() * _PyTime_FromNanosecondsObject() * _PyTime_FromTimeval() Other changes: * Add also os.times() tests to test_os. * pytime_fromtimeval() and pytime_fromtimeval() now return _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined behaviour * _PyTime_FromNanoseconds() parameter type changes from long long to _PyTime_t
* bpo-31917: Add 3 new clock identifiers (#4207)Victor Stinner2017-11-021-0/+9
| | | | | | | Add new clock identfiers: * time.CLOCK_BOOTTIME * time.CLOCK_PROF * time.CLOCK_UPTIME
* bpo-23699: Use a macro to reduce boilerplate code in rich comparison ↵stratakis2017-11-024-101/+6
| | | | functions (GH-793)
* bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). ↵Serhiy Storchaka2017-11-011-12/+26
| | | | (#4220)
* bpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and ↵Serhiy Storchaka2017-11-011-2/+10
| | | | | | earlier. (#3826) Skip a test for unget_wch()/get_wch() on OpenBSD since they are broken in ncurses 5.7.
* bpo-31919: Fix building the curses module on OpenIndiana. (#4211)Serhiy Storchaka2017-11-011-2/+4
|
* Remove nested comments in blake2 (#4173)Lars Viklund2017-11-011-2/+4
| | | | | | | | | | | Replace occurence of nested comments in blake2 reference implementation with preprocessor directive for disabling unused code. `blake2s-load-xop.h` is conditionally pulled in only on chips with XOP support, among others the AMD Bulldozer. The malformed comments in the source file breaks the build of `hashlib`'s `_blake2` on GCC 6.3.0. Official reference code on github uses `#if` so this change should be uncontroversial.
* bpo-25720: Fix the method for checking pad state of curses WINDOW (#4164)Masayuki Yamamoto2017-11-011-8/+16
| | | | | | | | | Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad().
* bpo-18835: Cleanup pymalloc (#4200)Victor Stinner2017-10-311-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup pymalloc: * Rename _PyObject_Alloc() to pymalloc_alloc() * Rename _PyObject_FreeImpl() to pymalloc_free() * Rename _PyObject_Realloc() to pymalloc_realloc() * pymalloc_alloc() and pymalloc_realloc() don't fallback on the raw allocator anymore, it now must be done by the caller * Add "success" and "failed" labels to pymalloc_alloc() and pymalloc_free() * pymalloc_alloc() and pymalloc_free() don't update num_allocated_blocks anymore: it should be done in the caller * _PyObject_Calloc() is now responsible to fill the memory block allocated by pymalloc with zeros * Simplify pymalloc_alloc() prototype * _PyObject_Realloc() now calls _PyObject_Malloc() rather than calling directly pymalloc_alloc() _PyMem_DebugRawAlloc() and _PyMem_DebugRawRealloc(): * document the layout of a memory block * don't increase the serial number if the allocation failed * check for integer overflow before computing the total size * add a 'data' variable to make the code easiler to follow test_setallocators() of _testcapimodule.c now test also the context.
* bpo-31893: Fix errors in b9052a0f91d2e83bbc27267247a5920c82b242a3. (#4196)Serhiy Storchaka2017-10-311-4/+4
| | | | | * Fix a compilation error on FreeBSD. * Fix the data attribute size on Mac OS X.
* bpo-31893: Fixed select.kqueue(). (#4166)Serhiy Storchaka2017-10-311-47/+71
| | | | * Fixed the layout of the kqueue_event structure on OpenBSD and NetBSD. * Fixed the comparison of the kqueue_event objects.
* bpo-31891: Fix building the curses module on NetBSD. (#4165)Serhiy Storchaka2017-10-311-33/+40
|
* faulthandler: use _PyTime_t rather than double for timeout (#4139)Victor Stinner2017-10-271-20/+31
| | | | | | | | | | | | | | | | | Use the _PyTime_t type rather than double for the faulthandler timeout in dump_traceback_later(). This change should fix the following Coverity warning: CID 1420311: Incorrect expression (UNINTENDED_INTEGER_DIVISION) Dividing integer expressions "9223372036854775807LL" and "1000LL", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored. if ((timeout * 1e6) >= (double) PY_TIMEOUT_MAX) { The warning comes from (double)PY_TIMEOUT_MAX with: #define PY_TIMEOUT_MAX (PY_LLONG_MAX / 1000)
* bpo-16135: Cleanup: Code rot left over from OS/2 support (GH-4147)Erik Bray2017-10-272-12/+1
| | | | Remove dangling references to PYCC_VACPP that are not relelvant since removal of OS/2 support.
* Fix _socket module compilation on Cygwin. (#4137)Erik Bray2017-10-271-1/+1
|
* Fix trailing whitespaces in C files. (#4130)Serhiy Storchaka2017-10-261-1/+1
|
* bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)xdegaye2017-10-261-0/+63
|
* fixes bpo-31866: remove code pertaining to AtheOS support (#4115)Benjamin Peterson2017-10-261-2/+0
| | | | We stop support this OS in 2007 with commit 19fab761b71a1687aee3415db3a937b5ce31975d. Let's finish.
* bpo-31845: Fix reading flags from environment (GH-4105)Nick Coghlan2017-10-251-30/+24
| | | | | | | | | | The startup refactoring means command line settings are now applied after settings are read from the environment. This updates the way command line settings are applied to account for that, ensures more settings are first read from the environment in _PyInitializeCore, and adds a simple test case covering the flags that are easy to check.
* bpo-30768: Recompute timeout on interrupted lock (GH-4103)Victor Stinner2017-10-244-14/+12
| | | | | | | | | | | | | | | | Fix the pthread+semaphore implementation of PyThread_acquire_lock_timed() when called with timeout > 0 and intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a signal (EINTR). See also the PEP 475. The pthread implementation of PyThread_acquire_lock() now fails with a fatal error if the timeout is larger than PY_TIMEOUT_MAX, as done in the Windows implementation. The check prevents any risk of overflow in PyThread_acquire_lock(). Add also PY_DWORD_MAX constant.
* bpo-31690: Allow the inline flags "a", "L", and "u" to be used as group ↵Serhiy Storchaka2017-10-244-68/+160
| | | | flags for RE. (#3885)
* bpo-31827: Remove os.stat_float_times() (GH-4061)Victor Stinner2017-10-241-44/+4
|
* fixes bpo-31834: Use optimized code for BLAKE2 only with SSSE3+ (#4066)Michał Górny2017-10-242-2/+6
| | | | | | | | | | | | | | | | Rework the code choosing BLAKE2 code paths from using the optimized variant on all x86_64 machines to using it when SSSE3 or better supported instructions sets are available. Firstly, this solves the problem of using pure SSE2 code path on x86_64 machines. As reported in the bug, this code is slower than the reference code on all tested x86_64 machines. Furthermore, on Athlon64 that lacks SSSE3, it is even 2.5 times slower than the reference code! Checking for SSSE3 therefore ensures that the optimized implementation will only be used when it has a chance of performing better. Secondly, this makes it possible to use SSSE3+ optimizations on 32-bit x86 systems. This allows for even 2 times speed gain on modern 32-bit x86 systems (tested in a 32-bit chroot).
* bpo-31653: Remove deadcode in semlock_acquire() (#4091)Victor Stinner2017-10-231-4/+4
| | | | | | | | | | Fix the following Coverity warning: >>> CID 1420038: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "res = sem_trywait(self->han...". 321 res = sem_trywait(self->handle); The deadcode was introduced by the commit c872d39d324cd6f1a71b73e10406bbaed192d35f.
* bpo-31752: Fix possible crash in timedelta constructor called with custom ↵Serhiy Storchaka2017-10-231-2/+7
| | | | | integers. (#3947) Bad remainder in divmod() in intermediate calculations caused an assertion failure.
* bpo-31572: Get rid of using _PyObject_HasAttrId() in pickle. (#3729)Serhiy Storchaka2017-10-221-30/+33
|
* bpo-31653: Don't release the GIL if we can acquire a multiprocessing ↵Antoine Pitrou2017-10-221-10/+20
| | | | semaphore immediately (#4078)
* bpo-31781: Prevent crashes when calling methods of an uninitialized ↵Oren Milman2017-10-201-0/+18
| | | | zipimport.zipimporter object (GH-3986)
* bpo-31819: Add AbstractEventLoop.sock_recv_into() (#4051)Antoine Pitrou2017-10-191-58/+156
| | | | | | | | * bpo-31819: Add AbstractEventLoop.sock_recv_into() * Add NEWS * Add doc
* bpo-31806: Use _PyTime_ROUND_TIMEOUT for the timeout argument parsing in ↵Pablo Galindo2017-10-183-6/+6
| | | | | | | | | more functions (#4026) Fix timeout rounding in time.sleep(), threading.Lock.acquire() and socket.socket.settimeout() to round correctly negative timeouts between -1.0 and 0.0. The functions now block waiting for events as expected. Previously, the call was incorrectly non-blocking.
* time.clock() now emits a DeprecationWarning (GH-4020)Victor Stinner2017-10-171-0/+7
| | | | | | | | | | bpo-31803: time.clock() and time.get_clock_info('clock') now emit a DeprecationWarning warning. Replace time.clock() with time.perf_counter() in tests and demos. Remove also hasattr(time, 'monotonic') in test_time since time.monotonic() is now always available since Python 3.5.
* bpo-31334: Fix timeout in select.poll.poll() (GH-3277)Riccardo Coccioli2017-10-171-9/+16
| | | | | | Always pass -1, or INFTIM where defined, to the poll() system call when a negative timeout is passed to the poll.poll([timeout]) method in the select module. Various OSes throw an error with arbitrary negative values.
* bpo-31786: Make functions in the select module blocking when timeout is a ↵Pablo Galindo2017-10-172-9/+10
| | | | small negative value. (#4003)
* bpo-31558: Add gc.freeze() (#3705)brainfvck2017-10-162-2/+134
| | | | | Freeze all the objects tracked by gc - move them to a permanent generation and ignore all the future collections. This can be used before a POSIX fork() call to make the gc copy-on-write friendly or to speed up collection.
* bpo-31773: _PyTime_GetPerfCounter() uses _PyTime_t (GH-3983)Victor Stinner2017-10-161-3/+4
| | | | | | | | * Rewrite win_perf_counter() to only use integers internally. * Add _PyTime_MulDiv() which compute "ticks * mul / div" in two parts (int part and remaining) to prevent integer overflow. * Clock frequency is checked at initialization for integer overflow. * Enhance also pymonotonic() to reduce the precision loss on macOS (mach_absolute_time() clock).