Commit Graph

44240 Commits

Author SHA1 Message Date
Pierre Glaser f22cc69b01 bpo-36867: Make semaphore_tracker track other system resources (GH-13222)
The multiprocessing.resource_tracker replaces the multiprocessing.semaphore_tracker module. Other than semaphores, resource_tracker also tracks shared_memory segments. Patch by Pierre Glaser.
2019-05-10 22:59:08 +02:00
Pierre Glaser d0d64ad1f5 bpo-36368: Ignore SIGINT in SharedMemoryManager servers. (GH-12483)
Fix a bug crashing SharedMemoryManager instances in interactive sessions after
a Ctrl-C (KeyboardInterrupt) was sent.
2019-05-10 20:42:35 +02:00
Jeroen Demeyer 351c67416b bpo-35983: skip trashcan for subclasses (GH-11841)
Add new trashcan macros to deal with a double deallocation that could occur when the `tp_dealloc` of a subclass calls the `tp_dealloc` of a base class and that base class uses the trashcan mechanism.

Patch by Jeroen Demeyer.
2019-05-10 19:21:10 +02:00
Olexa Bilaniuk 79efbb7193 bpo-24538: Fix bug in shutil involving the copying of xattrs to read-only files. (PR-13212)
Extended attributes can only be set on user-writeable files, but shutil previously
first chmod()ed the destination file to the source's permissions and then tried to
copy xattrs. This will cause failures if attempting to copy read-only files with
xattrs, as occurs with Git clones on Lustre FS.
2019-05-10 11:22:06 +08:00
Anthony Shaw 948ed8c96b bpo-36814: ensure os.posix_spawn() handles None (GH-13144)
Fix an issue where os.posix_spawn() would incorrectly raise a TypeError
when file_actions is None.
2019-05-10 04:00:06 +02:00
Rémi Lapeyre fce5ff1e18 bpo-27497: Add return value to csv.DictWriter.writeheader (GH-12306)
csv.DictWriter.writeheader() now returns the return value of the
underlying csv.Writer.writerow() method.

Patch contributed by Ashish Nitin Patil.
2019-05-10 03:50:11 +02:00
Victor Stinner d267ac20c3
bpo-36778: cp65001 encoding becomes an alias to utf_8 (GH-13230) 2019-05-10 03:19:54 +02:00
Andrew Svetlov a076e4f5e4
bpo-36802: Drop awrite()/aclose(), support await write() and await close() instead (#13099) 2019-05-09 15:14:58 -04:00
Pablo Galindo f00828a742
bpo-36851: Clean the frame stack if the execution ends with a return and the stack is not empty (GH-13191) 2019-05-09 16:52:02 +01:00
Jason R. Coombs 33e067d6a2 Add support for .parent and .joinpath in zipfile.Path (#13213) 2019-05-09 11:34:35 -04:00
Julien Palard afd1e6d2f0
bpo-36239: Skip comments in gettext infos (GH-12255) 2019-05-09 16:22:15 +02:00
Stefan Behnel 88db8bd064
bpo-36831: Do not apply default namespace to unprefixed attributes in ElementPath. (#13201)
Also provide better grouping of the tokenizer tests.
2019-05-09 07:22:47 +02:00
Benjamin Peterson 3aca40d3cb
closes bpo-36861: Update Unicode database to 12.1.0. (GH-13214)
Adds ㋿.
2019-05-08 20:59:35 -07:00
Pierre Glaser 289f1f80ee bpo-35900: Enable custom reduction callback registration in _pickle (GH-12499)
Enable custom reduction callback registration for functions and classes in
_pickle.c, using the new Pickler's attribute ``reducer_override``.
2019-05-08 23:08:25 +02:00
Eric V. Smith 9a4135e939
bpo-36817: Add f-string debugging using '='. (GH-13123)
If a "=" is specified a the end of an f-string expression, the f-string will evaluate to the text of the expression, followed by '=', followed by the repr of the value of the expression.
2019-05-08 16:28:48 -04:00
Pierre Glaser 65d98d0f53 bpo-35900: Add a state_setter arg to save_reduce (GH-12588)
Allow reduction methods to return a 6-item tuple where the 6th item specifies a
custom state-setting method that's called instead of the regular
``__setstate__`` method.
2019-05-08 21:40:25 +02:00
Brian Quinlan 39889864c0 bpo-26903: Limit ProcessPoolExecutor to 61 workers on Windows (GH-13132)
Co-Authored-By: brianquinlan <brian@sweetapp.com>
2019-05-08 14:04:53 -04:00
Zackery Spytz b9b08cd948 bpo-24758: Improve the error msg for unittest.mock.Mock()'s unsafe mode (#12991)
* bpo-24758: Improve the error msg for unittest.mock.Mock()'s unsafe mode

* Make the requested changes.
2019-05-08 23:02:23 +05:30
Gregory P. Smith 6bd81734de bpo-36816: Update the self-signed.pythontest.net cert (GH-13192)
We updated the server, our testsuite must match.


https://bugs.python.org/issue36816


✈️ CLE -> DEN ✈️ #pycon2019
2019-05-08 09:35:09 -07:00
Jason R. Coombs b2758ff955 bpo-36832: add zipfile.Path (#13153)
* bpo-36832: add zipfile.Path

* bpo-36832: add documentation for zipfile.Path

* 📜🤖 Added by blurb_it.

* Remove module reference from blurb.

* Sort the imports

* Update docstrings and docs per recommendations.

* Rely on test.support.temp_dir

* Signal that 'root' is the parameter.

* Correct spelling of 'mod'

* Convert docstring to comment for brevity.

* Fix more errors in the docs
2019-05-08 09:45:05 -04:00
Michael Blahay b1c3167c23 bpo-27639: Correct return type for UserList slicing operation (#13169)
* BPO-27639: Correct return type for UserList slicing operation

Added logic to __getitem__ magic method for UserList to ensure that the return
type matches that of self.
2019-05-07 17:41:06 -04:00
Riccardo Magliocchetti ca87eebb22 bpo-36015: Handle StreamHandler representaton of stream with an integer name (GH-11908) 2019-05-07 22:36:39 +01:00
Andrew Svetlov 1cc0ee7d9f bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport (GH-13098)
https://bugs.python.org/issue36801
2019-05-07 13:53:19 -07:00
Romain Picard b35acc5b3a bpo-35125: remove inner callback on outer cancellation in asyncio shield (GH-10340)
When the future returned by shield is cancelled, its completion callback of the
inner future is not removed. This makes the callback list of inner inner future
grow each time a shield is created and cancelled.

This change unregisters the callback from the inner future when the outer
future is cancelled.



https://bugs.python.org/issue35125
2019-05-07 11:58:24 -07:00
Brian Quinlan f7bda5c572 Don't import wait from connection, it shadows a name (GH-13112)
(lint cleanup) This import causes an argument parameter to shadow the global import name.
2019-05-07 13:31:11 -04:00
Vincent Michel 63deaa5b70 bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423)
*Moved from python/asyncio#493.*

This PR fixes issue python/asyncio#480, as explained in [this comment](https://github.com/python/asyncio/issues/480#issuecomment-278703828).

The `_SelectorDatagramTransport.sendto` method has to be modified ~~so `_sock.sendto` is used in all cases (because it is tricky to reliably tell if the socket is connected or not). Could that be an issue for connected sockets?~~ *EDIT* ... so `_sock.send` is used only if `_sock` is connected.

It also protects `socket.getsockname` against `OSError` in `_SelectorTransport`. This might happen on Windows if the socket is not connected (e.g. for UDP broadcasting).


https://bugs.python.org/issue31922
2019-05-07 10:18:49 -07:00
Gregory P. Smith 64aa6d2000
bpo-36533: Reinit logging.Handler locks on fork(). (GH-12704)
Instead of attempting to acquire and release them all across fork
which was leading to deadlocks in some applications that had chained
their own handlers while holding multiple locks.
2019-05-07 12:18:20 -04:00
Łukasz Langa bbbdc2bb65 Python 3.8.0a4
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAlzQfXsACgkQsmmV4xAl
 BWhB8g/+P+lbqKLZKb9X1W1deSMAoEt9fdHwRK4SXdSYiVAypMURR5qsexAuXILn
 VunaphcHniUq/LTMfyA6LAX8HjKPqwKPfHi7hKfwaoYKw/SCKi50tXgbuCGj/ZKK
 ix5HO76Jh4YFf6KV64c8Mkxas8Lk59ybLqAaI1D2maL9olYxvmmsEGpaXliEexfI
 heItUk5sGaz5ARXPaC5PlQEL3lgRE16dC1t1/vHCU1sseN2tf2XkIszsb9wF1ei/
 Wlg1gkDL6JetdUwxAyH4J/nZunSEeZ0MwJjzBGfWxc1fVhGzXDvyeWg2VQ3/OB46
 mH68RKOuVWLy+jQKbBuPDMOgyuTtM2L+bOmuGxKYkotL5EOIz6BmaRvH9VTJNoJ6
 xoUVHOSaOZDSVwA4EUBPNbYIVHj7E/11SJQKzBxDO15Pn/T9Zw8yz689yRDoFj42
 zCQK/a+2xvjm+WpvNZO4pwyoTOtvT7phirk7C9lV4KM3xH6jkGr6tHYkTFFRXfc0
 uXgIeq70jgb/qESojuBNQziVqhhHFhS6tZ/485jDYCkLytImZKRLhzOe9Xd+7WiI
 Vi1tUHbwgRmvimqNHFA7sFME3LI5ryDcDV7DLUL7sLK13m0iWQ4tSOT4TrERhGBG
 TL4KyAzspL5bC56Vt8DFuI/N4Byy5dN7tnFj7+5N7qgK1+Oshk0=
 =1r7h
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAlzRnIkQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaGzeD/9im9jmefZiVy+5GU4wSkfD4YEOCoh+Mrln
 KvQPO6h0d8Py/u2UBmwaWCpg4yeB2lc39oTyU6EPvbe3e10fsb0pfdInXqPNomt0
 PiMWviLe31TWBb4uw1664rhcHSpmfDpKEtAmWO/fOnl2gQqWCYVY+GHdpYI9h65o
 XYcm8PUZ2Knl/x0XZnnmTSZGkyf8GdbBpNFfe3V3twH7uirkxXV7KTxjyH93D8DO
 z8tCOtBncCMWsiHPCJ+Al5Q/c5Ymu6/D6MzmGeQuNWAl5saaudUJVXz0lKiixkVP
 zJDdCSBavMijmAK4sjr0PGT+fQCTVAJOvO5gWW79PfIbZJCIEV+QriCpIa0wXmQ3
 OXBQgdAAK1M+BE2TLUm5LUw5eWhjzbUbrNU0vchluy+UGbgw0hT10J0hATAlZaIM
 Y0BCnZl7qkBVrbrX+Dm+qoMRawgqt7DmK5OxBgH9LEErm8ryTEg0wtOANr5DDwMF
 TretjFwAnMhuz1kguvCAePd3JF0LRoEaf5dW/h4hz/sX1ldGMK1zm2B4nU6Yst8v
 RaEzDvBbxYAvRtWQO1i8wDOv8/VTpAGXfTskwofmxUZ5g0bqhiCgEw0PpMyN82Rw
 E2nsdrzV06zeSQrOPUGuy2vypuDMiqdguLsjKJQb6igHl1ThhXU1Nr3UHit1HCVL
 p0awZnaRyw==
 =i7by
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.0a4'

Python 3.8.0a4
2019-05-07 16:56:06 +02:00
Rémi Lapeyre 11a8832c98 bpo-31855: unittest.mock.mock_open() results now respects the argument of read([size]) (GH-11521)
unittest.mock.mock_open() results now respects the argument of read([size])

Co-Authored-By: remilapeyre <remi.lapeyre@henki.fr>
2019-05-07 11:48:36 +01:00
Andrew Svetlov ad4ed87241
Forbid creating of stream objects outside of asyncio (#13101) 2019-05-06 22:52:11 -04:00
Gregory P. Smith 2cc0223f43
bpo-35925: Skip SSL tests that fail due to weak external certs. (GH-13124)
Modern Linux distros such as Debian Buster have default OpenSSL system
configurations that reject connections to servers with weak certificates
by default.  This causes our test suite run with external networking
resources enabled to skip these tests when they encounter such a failure.

Fixing the network servers is a separate issue.
2019-05-06 17:54:06 -04:00
Serhiy Storchaka d53cf99dca
bpo-36542: Allow to overwrite the signature for Python functions. (GH-12705) 2019-05-06 22:40:27 +03:00
Serhiy Storchaka 96aeaec647
bpo-36793: Remove unneeded __str__ definitions. (GH-13081)
Classes that define __str__ the same as __repr__ can
just inherit it from object.
2019-05-06 22:29:40 +03:00
penguindustin 9646630895 bpo-36766: Typos in docs and code comments (GH-13116) 2019-05-06 14:57:17 -04:00
Łukasz Langa c1004b8546
Python 3.8.0a4 2019-05-06 20:30:25 +02:00
twisteroid ambassador 88f07a804a bpo-33530: Implement Happy Eyeballs in asyncio, v2 (GH-7237)
Added two keyword arguments, `delay` and `interleave`, to
`BaseEventLoop.create_connection`. Happy eyeballs is activated if
`delay` is specified.

We now have documentation for the new arguments. `staggered_race()` is in its own module, but not exported to the main asyncio package.


https://bugs.python.org/issue33530
2019-05-05 04:14:35 -07:00
Inada Naoki c4d92c8ada
simplify StartupImportTests (GH-13096)
_osx_support and copyreg are not imported from site on macOS for now.
2019-05-05 18:06:30 +09:00
Joannah Nanjekye 6b5b013bcc bpo-26978: Implement pathlib.Path.link_to (Using os.link) (GH-12990) 2019-05-04 17:27:10 +02:00
Stefan Behnel 47541689cc
bpo-28238: Implement "{*}tag" and "{ns}*" wildcard tag selection support for ElementPath, and extend the surrounding tests and docs. (GH-12997) 2019-05-03 20:58:16 +02:00
Zackery Spytz 4737b923df bpo-24638: Improve the error message in asyncio.ensure_future() (#12848) 2019-05-03 11:35:25 -04:00
gescheit c1964e9e21 bpo-36613: call remove_done_callback if exception (GH-12800)
Call remove_done_callback() in finally block.


https://bugs.python.org/issue36613
2019-05-03 08:18:02 -07:00
xdegaye 4461d704e2 bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399)
Those tests may fail with PermissionError.



https://bugs.python.org/issue36341
2019-05-03 08:09:17 -07:00
Stefan Behnel 45e92fc02d
Add correct license for C14N test suite to license docs. (GH-13055) 2019-05-02 22:11:04 +02:00
Victor Stinner 4631da1242
bpo-36763: Remove _PyCoreConfig._init_main (GH-13066) 2019-05-02 15:30:21 -04:00
Zackery Spytz 6ae2bbbdfc bpo-36776: Add @support.skip_unless_symlink to test_lll.py (GH-13058) 2019-05-02 14:54:59 -04:00
Xtreak 874ad1b3b4 Fix typo: quaatile to quantile (GH=13001) 2019-05-02 14:20:58 -04:00
Zackery Spytz c4e78b116f bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026) 2019-05-02 18:03:43 +03:00
Stefan Behnel 0d5864fa07
bpo-13611: Include C14N 2.0 test data in installation (GH-13053)
* Include C14N 2.0 test data in installation.
* Add README file to the C14N test data directory to reference the original source and licensing conditions.
2019-05-02 10:35:02 +02:00
Victor Stinner cb9fbd3588
bpo-36763: Make _PyCoreConfig.check_hash_pycs_mode public (GH-13052)
_PyCoreConfig: Rename _check_hash_pycs_mode field to
check_hash_pycs_mode (make it public) and change its type from "const
char*" to "wchar_t*".
2019-05-01 23:51:56 -04:00
Xtreak 11e4a941e9 Change bisect to bisect_cmd in docstring (#13040) 2019-05-01 22:49:49 -04:00