]> granicus.if.org Git - python/log
python
7 years agobpo-31810: added missing keywords to docs. (#4140)
Tom Floyer [Wed, 8 Nov 2017 17:31:26 +0000 (20:31 +0300)]
bpo-31810: added missing keywords to docs. (#4140)

async and await keywords has been merged into upstream, but they are
all missing in the lexical analysis docs. This change adds them to the
appropriate keywords section in documentation.

7 years agobpo-29179: Document the Py_UNUSED macro (#4341)
Petr Viktorin [Wed, 8 Nov 2017 15:59:20 +0000 (16:59 +0100)]
bpo-29179: Document the Py_UNUSED macro (#4341)

Py_UNUSED has a public name, and is used in the wild outside CPython,
but was not documented. Rectify that.

The macro was added in bpo-19976 and referenced in bpo-26179.

7 years agobpo-31934: Abort when building out of a not clean source tree (GH-4255)
xdegaye [Wed, 8 Nov 2017 15:03:58 +0000 (16:03 +0100)]
bpo-31934: Abort when building out of a not clean source tree (GH-4255)

7 years agobpo-31884 subprocess: add Windows constants for process priority (#4150)
James [Wed, 8 Nov 2017 14:18:59 +0000 (14:18 +0000)]
bpo-31884 subprocess: add Windows constants for process priority (#4150)

7 years agobpo-31338: C API intro: add missing versionadded (#4339)
Victor Stinner [Wed, 8 Nov 2017 14:06:24 +0000 (06:06 -0800)]
bpo-31338: C API intro: add missing versionadded (#4339)

7 years agoFix broken link in Doc/whatsnew/3.7.rst (GH-4335)
Berker Peksag [Wed, 8 Nov 2017 13:36:58 +0000 (16:36 +0300)]
Fix broken link in Doc/whatsnew/3.7.rst (GH-4335)

7 years agoDocs: Mention that Py_UNREACHABLE was added in 3.7 (#4337)
Petr Viktorin [Wed, 8 Nov 2017 13:11:16 +0000 (14:11 +0100)]
Docs: Mention that Py_UNREACHABLE was added in 3.7 (#4337)

The macro was added for bpo-31338 in commit b2e5794870eb4728ddfaafc0f79a40299576434f

7 years agobpo-21862: Add -m option to cProfile for profiling modules (#4297)
Sanyam Khurana [Wed, 8 Nov 2017 10:50:56 +0000 (16:20 +0530)]
bpo-21862: Add -m option to cProfile for profiling modules (#4297)

* bpo-21862: Add -m option to cProfile for profiling modules

7 years agoRemove unused var from CheckCancelOperation test (GH-4317)
Simon Willison [Tue, 7 Nov 2017 21:06:55 +0000 (13:06 -0800)]
Remove unused var from CheckCancelOperation test (GH-4317)

It looks like this was copied from one of the previous tests, which did use it.

7 years agoAdded :const:`mmap.ACCESS_DEFAULT` constant. (#4093)
Justus Schwabedal [Tue, 7 Nov 2017 20:51:43 +0000 (15:51 -0500)]
Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093)

7 years agobpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting...
Suren Nihalani [Tue, 7 Nov 2017 17:35:23 +0000 (09:35 -0800)]
bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (#3813)

7 years agoFix a typo (#4323)
Barry Warsaw [Tue, 7 Nov 2017 17:05:15 +0000 (09:05 -0800)]
Fix a typo (#4323)

7 years agobpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)
Julien Palard [Tue, 7 Nov 2017 16:46:50 +0000 (17:46 +0100)]
bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006)

7 years agobpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)
Antoine Pitrou [Tue, 7 Nov 2017 16:23:29 +0000 (17:23 +0100)]
bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)

* bpo-31970: Reduce performance overhead of asyncio debug mode.

7 years agobpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304)
Jelle Zijlstra [Tue, 7 Nov 2017 16:13:02 +0000 (08:13 -0800)]
bpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304)

* fix doc for multiprocessing.connection.Client

The authenticate argument does not exist on either Client or Listener:
- https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L483 (master)
- https://github.com/python/cpython/blob/3.6/Lib/multiprocessing/connection.py#L478 (3.6)
- https://github.com/python/cpython/blob/3.5/Lib/multiprocessing/connection.py#L478 (3.5)
- https://github.com/python/cpython/blob/3.4/Lib/multiprocessing/connection.py#L487 (3.4)
The documentation also claimed that these functions will call `current_process().auth_key`, for which I could find no evidence in the code. I rewrote the documentation to reflect the actual behavior.

Also made some small changes to vary sentence structure.

7 years agobpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319)
Antoine Pitrou [Tue, 7 Nov 2017 16:03:28 +0000 (17:03 +0100)]
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319)

7 years agoFix the sizeof test for dicts with shared keys. (#4311)
Serhiy Storchaka [Tue, 7 Nov 2017 13:08:09 +0000 (15:08 +0200)]
Fix the sizeof test for dicts with shared keys. (#4311)

By accident the size of the empty dict keys object matched the
size of values array.

7 years agobpo-20486: Implement Database.Close() method in msilib (GH-4141)
Berker Peksag [Tue, 7 Nov 2017 12:58:53 +0000 (15:58 +0300)]
bpo-20486: Implement Database.Close() method in msilib (GH-4141)

7 years agobpo-31626: Mark ends of the reallocated block in debug build. (#4210)
Serhiy Storchaka [Tue, 7 Nov 2017 10:46:42 +0000 (12:46 +0200)]
bpo-31626: Mark ends of the reallocated block in debug build. (#4210)

Few bytes at the begin and at the end of the reallocated blocks, as well
as the header and the trailer, now are erased before calling realloc()
in debug build.  This will help to detect using or double freeing the
reallocated block.

7 years agoFix a memory leak in _msi.c (#4127)
Zackery Spytz [Tue, 7 Nov 2017 10:03:09 +0000 (03:03 -0700)]
Fix a memory leak in _msi.c (#4127)

7 years agobpo-31950: Improve event loop policy doc (#4306)
Antoine Pitrou [Tue, 7 Nov 2017 09:26:32 +0000 (10:26 +0100)]
bpo-31950: Improve event loop policy doc (#4306)

7 years agoAdd asyncio.Handle.cancelled() method (#2388)
Marat Sharafutdinov [Tue, 7 Nov 2017 09:06:05 +0000 (12:06 +0300)]
Add asyncio.Handle.cancelled() method (#2388)

7 years agobpo-31415: Improve error handling and caching of the importtime option. (#4138)
Serhiy Storchaka [Tue, 7 Nov 2017 06:55:38 +0000 (08:55 +0200)]
bpo-31415: Improve error handling and caching of the importtime option. (#4138)

7 years agobpo-28791: Update Windows builds to use SQLite 3.21.0. (GH-4246)
Mariatta [Tue, 7 Nov 2017 03:31:53 +0000 (19:31 -0800)]
bpo-28791: Update Windows builds to use SQLite 3.21.0. (GH-4246)

7 years agoFix a minor typo and hyphenate "multi-threading" (#4237)
Barry Warsaw [Tue, 7 Nov 2017 02:18:40 +0000 (18:18 -0800)]
Fix a minor typo and hyphenate "multi-threading" (#4237)

7 years agobpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299)
Anders Lorentsen [Tue, 7 Nov 2017 00:47:43 +0000 (01:47 +0100)]
bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299)

7 years agobpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is...
Oren Milman [Tue, 7 Nov 2017 00:09:49 +0000 (02:09 +0200)]
bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (#3958)

7 years agobpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more...
Oren Milman [Tue, 7 Nov 2017 00:01:47 +0000 (02:01 +0200)]
bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (#3968)

7 years agobpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)
Nir Soffer [Mon, 6 Nov 2017 21:16:37 +0000 (23:16 +0200)]
bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)

blocksize was hardcoded to 8192, preventing efficient upload when using
file-like body. Add blocksize argument to __init__, so users can
configure the blocksize to fit their needs.

I tested this uploading data from /dev/zero to a web server dropping the
received data, to test the overhead of the HTTPConnection.send() with a
file-like object.

Here is an example 10g upload with the default buffer size (8192):

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 17.53 seconds (584.00m/s)

real 0m17.574s
user 0m8.887s
sys 0m5.971s

Same with 512k blocksize:

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 6.60 seconds (1551.15m/s)

real 0m6.641s
user 0m3.426s
sys 0m2.162s

In real world usage the difference will be smaller, depending on the
local and remote storage and the network.

See https://github.com/nirs/http-bench for more info.

7 years agobpo-31957: Fixes version detection. (#4298)
Steve Dower [Mon, 6 Nov 2017 20:52:09 +0000 (12:52 -0800)]
bpo-31957: Fixes version detection. (#4298)

7 years agoRemove outdated with_threads checks in configure.ac (GH-4294)
Berker Peksag [Mon, 6 Nov 2017 16:06:05 +0000 (19:06 +0300)]
Remove outdated with_threads checks in configure.ac (GH-4294)

7 years agoFix miscellaneous typos (#4275)
luzpaz [Sun, 5 Nov 2017 13:37:50 +0000 (07:37 -0600)]
Fix miscellaneous typos (#4275)

7 years agobpo-28994: PyErr_NormalizeException() no longer use C stack for recursion. (#2035)
Serhiy Storchaka [Sun, 5 Nov 2017 09:27:48 +0000 (11:27 +0200)]
bpo-28994: PyErr_NormalizeException() no longer use C stack for recursion. (#2035)

MemoryError raised when normalizing a RecursionError raised during exception normalization now not always causes a fatal error.

7 years agobpo-22257: Mention startup refactoring in What's New (GH-4286)
Nick Coghlan [Sun, 5 Nov 2017 04:58:45 +0000 (14:58 +1000)]
bpo-22257: Mention startup refactoring in What's New (GH-4286)

While technically a purely internal change, bpo-31845 was
a fairly significant externally visible bug caused by
these changes (environment variable based configuration
was being ignored due to a change in the relative order
of reading the environment and reading command line settings,
and the test suite was only testing the command line options)

Hence this note to essentially say "If you see odd startup
problems in 3.7 that you've never seen in previous releases,
it's probably our fault, so let us know, and we'll fix it".

7 years agobpo-31609: Fixes quotes in PCbuild/clean.bat (#4280)
Steve Dower [Sat, 4 Nov 2017 23:29:03 +0000 (16:29 -0700)]
bpo-31609: Fixes quotes in PCbuild/clean.bat (#4280)

7 years agobpo-31944: Fixes build and Modify button (#4278)
Steve Dower [Sat, 4 Nov 2017 23:28:47 +0000 (16:28 -0700)]
bpo-31944: Fixes build and Modify button (#4278)

7 years agobpo-31923: Fix spelling in sqlite3 docs (GH-4227)
davy wybiral [Sat, 4 Nov 2017 23:00:51 +0000 (18:00 -0500)]
bpo-31923: Fix spelling in sqlite3 docs (GH-4227)

7 years agoAdd version{changed,added} markers and make minor style changes (GH-4273)
Berker Peksag [Sat, 4 Nov 2017 12:17:56 +0000 (15:17 +0300)]
Add version{changed,added} markers and make minor style changes (GH-4273)

7 years agobpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)
Serhiy Storchaka [Sat, 4 Nov 2017 12:16:35 +0000 (14:16 +0200)]
bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)

This speeds up it to 20-40%.

7 years agobpo-31678: Fix typo in PyDateTime_DELTA_GET_MICROSECONDS (GH-3869)
Phobosmir [Sat, 4 Nov 2017 10:39:45 +0000 (13:39 +0300)]
bpo-31678: Fix typo in PyDateTime_DELTA_GET_MICROSECONDS (GH-3869)

7 years agobpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)
Antoine Pitrou [Sat, 4 Nov 2017 10:05:49 +0000 (11:05 +0100)]
bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)

* bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor

* Fix docstring

7 years agobpo-18699: Corrected documentation for window.chgat in curses module (#1430)
Chillar Anand [Sat, 4 Nov 2017 08:13:16 +0000 (13:43 +0530)]
bpo-18699: Corrected documentation for window.chgat in curses module (#1430)

7 years agobpo-9678: Fix determining the MAC address in the uuid module. (#4264)
Serhiy Storchaka [Sat, 4 Nov 2017 07:37:32 +0000 (09:37 +0200)]
bpo-9678: Fix determining the MAC address in the uuid module. (#4264)

* Using ifconfig on NetBSD and OpenBSD.
* Using arp on Linux, FreeBSD, NetBSD and OpenBSD.

Based on patch by Takayuki Shimizukawa.

7 years agoFix a grammatical problem and reword for clarity. (#4257)
Barry Warsaw [Fri, 3 Nov 2017 20:45:46 +0000 (13:45 -0700)]
Fix a grammatical problem and reword for clarity. (#4257)

bpo-31936

7 years agobpo-31933: fix blake2 multi-byte params on big endian platforms (#4250)
Jack O'Connor [Fri, 3 Nov 2017 19:02:41 +0000 (15:02 -0400)]
bpo-31933: fix blake2 multi-byte params on big endian platforms (#4250)

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.

7 years agobpo-30057: Fix potential missed signal in signal.signal(). (#4258)
Antoine Pitrou [Fri, 3 Nov 2017 18:58:46 +0000 (19:58 +0100)]
bpo-30057: Fix potential missed signal in signal.signal(). (#4258)

Bug report and patch by Jeroen Demeyer.

7 years agobpo-31924: Fix test_curses on NetBSD 8. (#4228)
Serhiy Storchaka [Fri, 3 Nov 2017 18:29:33 +0000 (20:29 +0200)]
bpo-31924: Fix test_curses on NetBSD 8. (#4228)

7 years agobpo-31310: multiprocessing's semaphore tracker should be launched again if crashed...
Antoine Pitrou [Fri, 3 Nov 2017 13:31:38 +0000 (14:31 +0100)]
bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed (#3247)

* bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed

* Avoid mucking with process state in test.
Add a warning if the semaphore process died, as semaphores may then be leaked.

* Add NEWS entry

7 years agobpo-31308: If multiprocessing's forkserver dies, launch it again when necessary ...
Antoine Pitrou [Fri, 3 Nov 2017 12:34:22 +0000 (13:34 +0100)]
bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary (#3246)

* bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary.

* Fix test on Windows

* Add NEWS entry

* Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker.

* Fix comment

* Make sure the test doesn't muck with process state

* Also test previously-started processes

* Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst

* Avoid masking SIGTERM in forkserver.  It's not necessary and causes a race condition in test_many_processes.

7 years agobpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)
Tal Einat [Fri, 3 Nov 2017 09:09:00 +0000 (11:09 +0200)]
bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)

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.

7 years agobpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240)
Barry Warsaw [Thu, 2 Nov 2017 23:13:36 +0000 (16:13 -0700)]
bpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240)

Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime

7 years agobpo-31890: define METH_STACKLESS (#4159)
Anselm Kruis [Thu, 2 Nov 2017 22:54:57 +0000 (23:54 +0100)]
bpo-31890: define METH_STACKLESS (#4159)

Add METH_STACKLESS to prevent future collisions.

7 years agobpo-28643: Record profile-opt build progress with stamp files (#4223)
Neil Schemenauer [Thu, 2 Nov 2017 17:46:02 +0000 (10:46 -0700)]
bpo-28643: Record profile-opt build progress with stamp files (#4223)

* bpo-28643: Record profile-opt build progress with stamp files

The profile-opt makefile target is expensive to build. Since the
makefile does not contain complete dependency information for this
target, much extra work can get done if the build is interrupted and
re-started.  Even running "make" a second time will result in a huge
amount of redundant work.

As a minimal fix (rather than removing recursive "make" and adding a
proper dependency graph), split the profile-opt target into parts:

- ensure tree is clean (profile-clean-stamp)
- build with profile generation enabled (profile-gen-stamp)
- run task to generate profile information (profile-run-stamp)
- build optimized Python using above information (profile-opt)

We use "stamp" files to record completion of the steps.  Running
"make clean" will not remove the profile-run-stamp file.

Other minor changes:

- remove the "build_all_use_profile" target.  I don't expect callers
  of the makefile to use this target so that should be safe.

- remove execution of "profile-removal" at end of "profile-opt".  I
  don't see any reason to not to keep the profile information, given
  the cost to generate it.  Removing the "profile-run-stamp" file
  will force re-generation of it.

7 years agoUpdate multissltests: 1.0.2m, 1.1.0g (#4232)
Christian Heimes [Thu, 2 Nov 2017 16:38:11 +0000 (17:38 +0100)]
Update multissltests: 1.0.2m, 1.1.0g (#4232)

7 years agoReturning 1 from the set_progress_handler handler cancels query (GH-4120)
Simon Willison [Thu, 2 Nov 2017 14:34:12 +0000 (07:34 -0700)]
Returning 1 from the set_progress_handler handler cancels query (GH-4120)

7 years agobpo-31784: Implement PEP 564: add time.time_ns() (#3989)
Victor Stinner [Thu, 2 Nov 2017 14:28:27 +0000 (07:28 -0700)]
bpo-31784: Implement PEP 564: add time.time_ns() (#3989)

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

7 years agobpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420)
Vincent Michel [Thu, 2 Nov 2017 12:47:04 +0000 (13:47 +0100)]
bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420)

7 years agobpo-31917: Add 3 new clock identifiers (#4207)
Victor Stinner [Thu, 2 Nov 2017 11:19:19 +0000 (04:19 -0700)]
bpo-31917: Add 3 new clock identifiers (#4207)

Add new clock identfiers:

* time.CLOCK_BOOTTIME
* time.CLOCK_PROF
* time.CLOCK_UPTIME

7 years agobpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH...
stratakis [Thu, 2 Nov 2017 10:32:54 +0000 (11:32 +0100)]
bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793)

7 years agobpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (#4220)
Serhiy Storchaka [Wed, 1 Nov 2017 18:48:49 +0000 (20:48 +0200)]
bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (#4220)

7 years agobpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and earlier. ...
Serhiy Storchaka [Wed, 1 Nov 2017 14:03:40 +0000 (16:03 +0200)]
bpo-15037: Add a workaround for getkey() in curses for ncurses 5.7 and earlier. (#3826)

Skip a test for unget_wch()/get_wch() on OpenBSD since they are broken
in ncurses 5.7.

7 years ago[asyncio] bpo-30423: add regression test for orphan future causes "RuntimeError:...
jimmylai [Wed, 1 Nov 2017 13:54:45 +0000 (06:54 -0700)]
[asyncio] bpo-30423: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed." (#3295)

* call remove_done_callback in finally section

* [asyncio] bpo-30423 bug: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed."

7 years agobpo-31919: Fix building the curses module on OpenIndiana. (#4211)
Serhiy Storchaka [Wed, 1 Nov 2017 12:34:20 +0000 (14:34 +0200)]
bpo-31919: Fix building the curses module on OpenIndiana. (#4211)

7 years agoRemove nested comments in blake2 (#4173)
Lars Viklund [Wed, 1 Nov 2017 12:23:09 +0000 (13:23 +0100)]
Remove nested comments in blake2 (#4173)

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.

7 years agobpo-25720: Fix the method for checking pad state of curses WINDOW (#4164)
Masayuki Yamamoto [Wed, 1 Nov 2017 12:05:26 +0000 (21:05 +0900)]
bpo-25720: Fix the method for checking pad state of curses WINDOW (#4164)

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().

7 years agoFix test_socket.test_create_connection() (#4206)
Victor Stinner [Wed, 1 Nov 2017 02:48:14 +0000 (19:48 -0700)]
Fix test_socket.test_create_connection() (#4206)

bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to
fix the test on Travis CI.

7 years agobpo-18835: Cleanup pymalloc (#4200)
Victor Stinner [Tue, 31 Oct 2017 19:18:10 +0000 (12:18 -0700)]
bpo-18835: Cleanup pymalloc (#4200)

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.

7 years agobpo-20064: Document PyObject_Malloc() (#4199)
Victor Stinner [Tue, 31 Oct 2017 16:37:25 +0000 (09:37 -0700)]
bpo-20064: Document PyObject_Malloc() (#4199)

Document the following functions:

* PyObject_Malloc()
* PyObject_Calloc()
* PyObject_Realloc()
* PyObject_Free()

Fix also PyMem_RawFree() documentation.

7 years agobpo-31893: Fix errors in b9052a0f91d2e83bbc27267247a5920c82b242a3. (#4196)
Serhiy Storchaka [Tue, 31 Oct 2017 16:18:21 +0000 (18:18 +0200)]
bpo-31893: Fix errors in b9052a0f91d2e83bbc27267247a5920c82b242a3. (#4196)

* Fix a compilation error on FreeBSD.
* Fix the data attribute size on Mac OS X.

7 years agopythoninfo: add Py_DEBUG (#4198)
Victor Stinner [Tue, 31 Oct 2017 15:41:10 +0000 (08:41 -0700)]
pythoninfo: add Py_DEBUG (#4198)

7 years agotest_capi.test__testcapi() becomes more verbose (#4197)
Victor Stinner [Tue, 31 Oct 2017 15:40:59 +0000 (08:40 -0700)]
test_capi.test__testcapi() becomes more verbose (#4197)

Write the name of each subtest on a new line to help debugging when
a test does crash Python.

7 years agobpo-31897: Convert unexpected errors when read bogus binary plists into InvalidFileEx...
Serhiy Storchaka [Tue, 31 Oct 2017 12:05:53 +0000 (14:05 +0200)]
bpo-31897: Convert unexpected errors when read bogus binary plists into InvalidFileException. (#4171)

7 years agobpo-31626: Fixed a bug in debug memory allocator. (#3844)
Serhiy Storchaka [Tue, 31 Oct 2017 12:05:03 +0000 (14:05 +0200)]
bpo-31626: Fixed a bug in debug memory allocator. (#3844)

Removed a code that incorrectly detected in-place resizing in realloc()
 and wrote to freed memory.

7 years agobpo-31893: Fixed select.kqueue(). (#4166)
Serhiy Storchaka [Tue, 31 Oct 2017 11:59:55 +0000 (13:59 +0200)]
bpo-31893: Fixed select.kqueue(). (#4166)

* Fixed the layout of the kqueue_event structure on OpenBSD and NetBSD.
* Fixed the comparison of the kqueue_event objects.

7 years agobpo-31891: Fix building the curses module on NetBSD. (#4165)
Serhiy Storchaka [Tue, 31 Oct 2017 11:56:44 +0000 (13:56 +0200)]
bpo-31891: Fix building the curses module on NetBSD. (#4165)

7 years agobpo-31629: Add support.SaveSignals (#4183)
Victor Stinner [Tue, 31 Oct 2017 10:14:01 +0000 (03:14 -0700)]
bpo-31629: Add support.SaveSignals (#4183)

test_curses now saves/restores signals. On FreeBSD, the curses module
sets handlers of some signals, but don't restore old handlers when
the module is deinitialized.

7 years agoRemove tiny bit of deadcode from wsgiref.validate (#3996)
Alex Gaynor [Tue, 31 Oct 2017 04:07:36 +0000 (00:07 -0400)]
Remove tiny bit of deadcode from wsgiref.validate (#3996)

7 years agobpo-31304: Update starmap_async documentation. (GH-4168)
Pablo Galindo [Mon, 30 Oct 2017 18:39:28 +0000 (18:39 +0000)]
bpo-31304: Update starmap_async documentation. (GH-4168)

Update the kwarg in the documentation of `multiprocessing.pool.Pool.starmap_async`, from `error_back` to `error_callback` to match the source code..

7 years agobpo-31245: Asyncio unix socket datagram (#3164)
Quentin Dawans [Mon, 30 Oct 2017 13:43:02 +0000 (14:43 +0100)]
bpo-31245: Asyncio unix socket datagram (#3164)

7 years agobpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
Serhiy Storchaka [Sat, 28 Oct 2017 23:11:54 +0000 (02:11 +0300)]
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)

separators that are not bytes-like objects.

7 years agobpo-31836: Test_code_module now passes with sys.ps1, ps2 set (#4070)
Terry Jan Reedy [Sat, 28 Oct 2017 01:45:19 +0000 (21:45 -0400)]
bpo-31836: Test_code_module now passes with sys.ps1, ps2 set (#4070)

7 years agoIDLE -- Restrict shell prompt manipulaton to the shell. (#4143)
Terry Jan Reedy [Sat, 28 Oct 2017 00:26:12 +0000 (20:26 -0400)]
IDLE -- Restrict shell prompt manipulaton to the shell. (#4143)

Editor and output windows only see an empty last prompt line.
This simplifies the code and fixes a minor bug when newline is inserted.
Sys.ps1, if present, is read on Shell start-up, but is not set or changed.

7 years agobpo-31860: Make the font sample in the IDLE font configuration dialog editable. ...
Serhiy Storchaka [Sat, 28 Oct 2017 00:22:44 +0000 (03:22 +0300)]
bpo-31860: Make the font sample in the IDLE font configuration dialog editable. (#4106)

Changes persist while IDLE remains open

7 years agofaulthandler: use _PyTime_t rather than double for timeout (#4139)
Victor Stinner [Fri, 27 Oct 2017 14:27:12 +0000 (07:27 -0700)]
faulthandler: use _PyTime_t rather than double for timeout (#4139)

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)

7 years agobpo-31174: Improve the code of test_tools.test_unparse. (#4146)
Serhiy Storchaka [Fri, 27 Oct 2017 12:35:11 +0000 (15:35 +0300)]
bpo-31174: Improve the code of test_tools.test_unparse. (#4146)

7 years agobpo-16135: Cleanup: Code rot left over from OS/2 support (GH-4147)
Erik Bray [Fri, 27 Oct 2017 12:27:06 +0000 (14:27 +0200)]
bpo-16135: Cleanup: Code rot left over from OS/2 support (GH-4147)

Remove dangling references to PYCC_VACPP that are not relelvant
since removal of OS/2 support.

7 years agobpo-31545: Update documentation containing timedelta repr. (GH-3687)
Utkarsh Upadhyay [Fri, 27 Oct 2017 11:25:15 +0000 (13:25 +0200)]
bpo-31545: Update documentation containing timedelta repr. (GH-3687)

This is a fix to the documentation to reflect the changes merged
in as part of bpo-30302.

7 years agoFix _socket module compilation on Cygwin. (#4137)
Erik Bray [Fri, 27 Oct 2017 10:01:17 +0000 (12:01 +0200)]
Fix _socket module compilation on Cygwin. (#4137)

7 years agobpo-31877: Add _Py_LegacyLocaleDetected and _PyCoerceLegacyLocale to pylifecycle...
Erik Bray [Fri, 27 Oct 2017 09:46:03 +0000 (11:46 +0200)]
bpo-31877: Add _Py_LegacyLocaleDetected and _PyCoerceLegacyLocale to pylifecycle.h (GH-4134)

Only declaring these as interns inside the CLI's main C module
caused build problems on some platforms (notably Cygwin), so
this switches them to a regular underscore prefixed "private" C
API declaration.

7 years agoFixed sorting order of the LogRecord attributes in the documentation. (GH-4133)
Arthur Darcet [Fri, 27 Oct 2017 07:06:20 +0000 (09:06 +0200)]
Fixed sorting order of the LogRecord attributes in the documentation. (GH-4133)

7 years agobpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812)
Lovesh Harchandani [Fri, 27 Oct 2017 07:04:33 +0000 (09:04 +0200)]
bpo-30989: Sort in TimedRotatingFileHandler only when needed. (GH-2812)

TimedRotatingFileHandler.getFilesToDelete() now sorts only when needed.

7 years agobpo-31053: Remove redundant 'venv' argument in venv example (GH-2907)
cocoatomo [Fri, 27 Oct 2017 04:42:11 +0000 (13:42 +0900)]
bpo-31053: Remove redundant 'venv' argument in venv example (GH-2907)

7 years agobpo-28936: Detect lexically first syntax error first (#4097)
Ivan Levkivskyi [Thu, 26 Oct 2017 21:28:35 +0000 (23:28 +0200)]
bpo-28936: Detect lexically first syntax error first (#4097)

Lexically first global and nonlocal syntax errors at given scope should be detected first.

7 years agoCloses bpo-28281: Remove year (1-9999) limits on the weekday() function. (#4109)
Alexander Belopolsky [Thu, 26 Oct 2017 19:34:11 +0000 (15:34 -0400)]
Closes bpo-28281: Remove year (1-9999) limits on the weekday() function. (#4109)

Patch by Mark Gollahon.

7 years agobpo-30553: Add status code 421 to http.HTTPStatus (GH-2589)
Vitor Pereira [Thu, 26 Oct 2017 18:49:19 +0000 (19:49 +0100)]
bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589)

7 years agoFix trailing whitespaces in C files. (#4130)
Serhiy Storchaka [Thu, 26 Oct 2017 13:59:40 +0000 (16:59 +0300)]
Fix trailing whitespaces in C files. (#4130)

7 years agobpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)
xdegaye [Thu, 26 Oct 2017 13:09:06 +0000 (15:09 +0200)]
bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)

7 years agobpo-30937: Make usage of newline='' consistent in csv docs (GH-2730)
Ammar Askar [Thu, 26 Oct 2017 08:27:46 +0000 (04:27 -0400)]
bpo-30937: Make usage of newline='' consistent in csv docs (GH-2730)

7 years agobpo-21720: Restore the Python 2.7 logic in handling a fromlist. (#4118)
Serhiy Storchaka [Thu, 26 Oct 2017 07:41:59 +0000 (10:41 +0300)]
bpo-21720: Restore the Python 2.7 logic in handling a fromlist. (#4118)

BytesWarning no longer emitted when the fromlist argument of
__import__() or the __all__ attribute of the module contain bytes
instances.

7 years agofixes bpo-31866: remove code pertaining to AtheOS support (#4115)
Benjamin Peterson [Thu, 26 Oct 2017 06:55:14 +0000 (23:55 -0700)]
fixes bpo-31866: remove code pertaining to AtheOS support (#4115)

We stop support this OS in 2007 with commit
19fab761b71a1687aee3415db3a937b5ce31975d. Let's finish.