Commit Graph

20489 Commits

Author SHA1 Message Date
Andrey Egorov e1d62e0b7c bpo-32015: Asyncio looping during simultaneously socket read/write an… (#4386)
* bpo-32015: Asyncio cycling during simultaneously socket read/write and reconnection

* Tests fix

* Tests fix

* News add

* Add new unit tests
2017-11-14 11:18:59 +02:00
Yury Selivanov ce12629c84
bpo-28369: Enhance transport socket check in add_reader/writer (#4365) 2017-11-13 13:38:22 -05:00
xdegaye e0582a37c8
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160) 2017-11-12 16:50:48 +01:00
xdegaye 1588be66d7
bpo-28180: Fix the implementation of PEP 538 on Android (GH-4334) 2017-11-12 12:45:59 +01:00
benfogle 9703f092ab bpo-31976: Fix race condition when flushing a file is slow. (#4331) 2017-11-10 22:03:40 +01:00
Brian Curtin 9f914a01af
bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)
The openfp functions of aifp, sunau, and wave had pointed to the open
function of each module since 1993 as a matter of backwards
compatibility. In the case of aifc.openfp, it was both undocumented
and untested. This change begins the formal deprecation of those
openfp functions, with their removal coming in 3.9.

This additionally adds a TODO in test_pyclbr around using aifc.openfp,
though it shouldn't be changed until removal in 3.9.
2017-11-10 11:38:25 -05:00
Serhiy Storchaka d3187158c0
bpo-31927: Fix bugs in socketmodule.c on NetBSD and other issues. (#4235)
* 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.
2017-11-09 18:00:38 +02:00
Victor Stinner 8c663fd60e
Replace KB unit with KiB (#4293)
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.
2017-11-08 14:44:44 -08:00
xdegaye 0de92859ca
bpo-31934: Abort when building out of a not clean source tree (GH-4255) 2017-11-08 16:03:58 +01:00
James b5d9e08114 bpo-31884 subprocess: add Windows constants for process priority (#4150) 2017-11-08 06:18:59 -08:00
Sanyam Khurana 7973e279a2 bpo-21862: Add -m option to cProfile for profiling modules (#4297)
* bpo-21862: Add -m option to cProfile for profiling modules
2017-11-08 11:50:56 +01:00
Justus Schwabedal 5a8a84b34f Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093) 2017-11-07 12:51:43 -08:00
Suren Nihalani c62f0cb3b1 bpo-31620: have asyncio/queues not leak memory when you've exceptions during waiting (#3813) 2017-11-07 20:35:23 +03:00
Antoine Pitrou 921e9432a1
bpo-31970: Reduce performance overhead of asyncio debug mode. (#4314)
* bpo-31970: Reduce performance overhead of asyncio debug mode.
2017-11-07 17:23:29 +01:00
Berker Peksag a935654f06
bpo-20486: Implement Database.Close() method in msilib (GH-4141) 2017-11-07 15:58:53 +03:00
Marat Sharafutdinov 69cfed1cd7 Add asyncio.Handle.cancelled() method (#2388) 2017-11-07 12:06:05 +03:00
Mariatta 31af650ee2
bpo-28791: Update Windows builds to use SQLite 3.21.0. (GH-4246) 2017-11-06 19:31:53 -08:00
Anders Lorentsen a22a127458 bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299) 2017-11-06 16:47:43 -08:00
Oren Milman edb13ae48c bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (#3958) 2017-11-06 16:09:49 -08:00
Oren Milman e56ab746a9 bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (#3968) 2017-11-06 16:01:47 -08:00
Nir Soffer ad455cd924 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.
2017-11-06 13:16:37 -08:00
Steve Dower 30f4fa456e
bpo-31957: Fixes version detection. (#4298) 2017-11-06 12:52:09 -08:00
luzpaz a5293b4ff2 Fix miscellaneous typos (#4275) 2017-11-05 15:37:50 +02:00
Steve Dower aed0856222
bpo-31609: Fixes quotes in PCbuild/clean.bat (#4280) 2017-11-04 16:29:03 -07:00
Steve Dower 0d2a9088d1
bpo-31944: Fixes build and Modify button (#4278) 2017-11-04 16:28:47 -07:00
Serhiy Storchaka d4d79bc1ff
bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)
This speeds up it to 20-40%.
2017-11-04 14:16:35 +02:00
Antoine Pitrou 63ff4131af
bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)
* bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor

* Fix docstring
2017-11-04 11:05:49 +01:00
Serhiy Storchaka ee1a9a2b78
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.
2017-11-04 09:37:32 +02:00
Jack O'Connor dcfb0e3c04 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.
2017-11-03 20:02:41 +01:00
Antoine Pitrou f6f90ff079
bpo-30057: Fix potential missed signal in signal.signal(). (#4258)
Bug report and patch by Jeroen Demeyer.
2017-11-03 19:58:46 +01:00
Antoine Pitrou cbe1756e3e
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
2017-11-03 14:31:38 +01:00
Antoine Pitrou fc6b348b12
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.
2017-11-03 13:34:22 +01:00
Tal Einat 4f57409a2f 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.
2017-11-03 11:09:00 +02:00
Barry Warsaw 700d2e4755
bpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240)
Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime
2017-11-02 16:13:36 -07:00
Neil Schemenauer 4e38d71a2b
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.
2017-11-02 10:46:02 -07:00
Victor Stinner c29b585fd4
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
2017-11-02 07:28:27 -07:00
Vincent Michel e314853d57 bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420) 2017-11-02 15:47:04 +03:00
Victor Stinner a64ce973a3
bpo-31917: Add 3 new clock identifiers (#4207)
Add new clock identfiers:

* time.CLOCK_BOOTTIME
* time.CLOCK_PROF
* time.CLOCK_UPTIME
2017-11-02 04:19:19 -07:00
stratakis e8b1965639 bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
Serhiy Storchaka 4f469c0966
bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (#4220) 2017-11-01 20:48:49 +02:00
Serhiy Storchaka 7e68790f3d
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.
2017-11-01 16:03:40 +02:00
Masayuki Yamamoto 8bc7d63560 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().
2017-11-01 14:05:26 +02:00
Serhiy Storchaka db91e0fe24
bpo-31897: Convert unexpected errors when read bogus binary plists into InvalidFileException. (#4171) 2017-10-31 14:05:53 +02:00
Serhiy Storchaka b484d5606c
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.
2017-10-31 14:05:03 +02:00
Serhiy Storchaka b9052a0f91
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.
2017-10-31 13:59:55 +02:00
Serhiy Storchaka baac01e629
bpo-31891: Fix building the curses module on NetBSD. (#4165) 2017-10-31 13:56:44 +02:00
Quentin Dawans fe4ea9cf1e bpo-31245: Asyncio unix socket datagram (#3164) 2017-10-30 09:43:02 -04:00
Serhiy Storchaka a2314283ff
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
2017-10-29 02:11:54 +03:00
Terry Jan Reedy 5a4bbcd479
bpo-31836: Test_code_module now passes with sys.ps1, ps2 set (#4070) 2017-10-27 21:45:19 -04:00
Terry Jan Reedy e86172d63a
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.
2017-10-27 20:26:12 -04:00