Commit Graph

102333 Commits

Author SHA1 Message Date
Benjamin Peterson 5033aa77aa
bpo-34625: Update vendorized expat version to 2.2.6. (GH-9150) 2018-09-10 21:04:00 -07:00
Raymond Hettinger 2064bb6d57
Fix missing line from example shell session (GH-9143) 2018-09-10 18:43:08 -07:00
Matthias Bussonnier ffa198c642 bpo-33487: improve BZ2File Deprecation and documentation. (GH-6785)
Emit warning when None passed explicitly, list Python version since
deprecation in warning message and docs.
2018-09-10 18:15:56 -07:00
Lew Kurtz f019579828 bpo-33460: remove ellipsis that look like continuation prompts (GH-7851)
Remove ellipsis that look like continuation prompts,
has a side benefit of putting rest of error message in proper text color.
2018-09-10 18:13:08 -07:00
Ville Skyttä 959625b5a5 Use bytes.hex instead of binascii.hexlify in pbkdf2_hmac example (GH-8420) 2018-09-10 18:07:19 -07:00
Daniel Hahler e578fa162e Lib/test/support: fix typo in docstring (GH-8506) 2018-09-10 18:04:33 -07:00
Anthony Sottile ed2e9ab804 Remove obsolete comment about latin-1 in `normalize_encoding` (GH-8739)
This docstring has drifted since python2: ca079a3ea3/Lib/encodings/__init__.py (L68)
2018-09-10 17:54:37 -07:00
Gregory P. Smith ce34410b8b
bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242)
When subprocess.Popen() stdin= stdout= or stderr= handles are specified
and appear in pass_fds=, don't close the original fds after dup'ing them.

This implementation and unittest primarily came from @izbyshev (see the PR)

See also b89b52f284

This also removes the old manual p2cread, c2pwrite, and errwrite closing logic
as inheritable flags and _close_open_fds takes care of that properly today without special treatment.

This code is within child_exec() where it is the only thread so there is no
race condition between the dup and _Py_set_inheritable_async_safe call.
2018-09-10 17:46:22 -07:00
Zachary Ware 880d42a3b2
bpo-8110: Refactor platform detection in subprocess (GH-9053)
Check for functionality via imports rather than checking sys.platform
specifically for Windows
2018-09-10 16:16:08 -07:00
NotAFile 28ea4c2847 switch descriptor howto to return value annotation (GH-7796) 2018-09-10 14:35:38 -07:00
Tal Einat 3286ce4ade bpo-20180: itertools.groupby Argument Clinic conversion (GH-4170) 2018-09-10 11:33:08 -07:00
Rahul Jha 9430652535 bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651)
* bpo-33217: Raise TypeError for non-Enum lookups in Enums
2018-09-10 11:21:04 -07:00
Matthias Bussonnier 51a4743d19 bpo-33604: Remove deprecated HMAC default value marked for removal in 3.8 (GH-7063)
HMAC's digestmod was deprecated marked for removal, this removes it as planned.
2018-09-10 11:10:01 -07:00
Sebastian Rittau 78deb7f332 closes bpo-34525: Fix smtplib's authobject() documentation (GH-8965) 2018-09-10 10:29:43 -07:00
Berker Peksag 9797b7ae44 bpo-26502: Implement FrameSummary.__len__() (GH-8632) 2018-09-10 10:02:33 -07:00
Peter Eisentraut 0e0bc4e221 Fix misleading mentions of tp_size in comments (GH-9093)
Many type object initializations labeled a field "tp_size" in the
comment, but the name of that field is tp_basicsize.
2018-09-10 09:46:08 -07:00
Benjamin Peterson d545869d08
bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)
The recursive frame pruning code always undercounted the number of elided frames
by one. That is, in the "[Previous line repeated N more times]" message, N would
always be one too few. Near the recursive pruning cutoff, one frame could be
silently dropped. That situation is demonstrated in the OP of the bug report.

The fix is to start the identical frame counter at 1.
2018-09-10 08:43:10 -07:00
Tal Einat 54752533b2
bpo-30977: rework code changes according to post-merge code review (GH-9106)
also mention the change and its consequences in What's New
2018-09-10 16:11:04 +03:00
Sergey Fedoseev 1f36bf6077 Test dict values iterator pickling with pickle.HIGHEST_PROTOCOL. (GH-9052) 2018-09-10 17:42:09 +08:00
Rémy HUBSCHER 290a60bd8a Revert "Fix misindented yaml in logging how to example (GH-8604)" (GH-9081)
This reverts commit 10b59f1b01.
2018-09-10 17:07:15 +08:00
Zackery Spytz 5061a74a4c Remove unneeded PyUnicode_READY() in tokenizer.c (GH-9114) 2018-09-10 09:27:31 +03:00
Julien Malard 0afada163c bpo-34421 avoid unicode error in distutils logging (GH-8799)
This caused installation errors in some cases on Windows.
Patch by Julien Malard.
2018-09-08 16:31:26 -04:00
Serhiy Storchaka d700f97b62
bpo-20104: Change the file_actions parameter of os.posix_spawn(). (GH-6725)
* Make its default value an empty tuple instead of None.
* Make it a keyword-only parameter.
2018-09-08 14:48:18 +03:00
Pablo Galindo fa221d804f
bpo-33083: Update "What's new" with math.factorial changes (GH-9109)
* Add elimination of non-int-like parameters in math.factorial to "What's new".
2018-09-08 00:16:17 +01:00
Pablo Galindo 5b7a2cb5ca
bpo-34246: Make sure test_smtplib always cleans resources when finished (GH-9108)
* Make sure that when some of the tests in test_smtplib fail, the allocated threads
and sockets are not leaked. 

* Use support.join_thread() instead of thread.join() to avoid infinite blocks.
2018-09-08 00:15:22 +01:00
Pablo Aguiar d5fbe9b1a3 bpo-34246: Use no mutable default args in smtplib (GH-8554)
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
2018-09-07 23:04:48 +01:00
Zackery Spytz 4e519377b1 bpo-23855: Add missing NULL checks for malloc() in _msi.c (GH-9038) 2018-09-08 01:02:56 +03:00
William Grzybowski 28658485a5 bpo-34604: Fix possible mojibake in pwd.getpwnam() and grp.getgrnam() (GH-9098)
Pass the user/group name as Unicode to the formatting function,
instead of always decoding a bytes string from UTF-8.
2018-09-07 19:10:39 +02:00
Victor Stinner 7e610bcdf1
bpo-34605: childs => children (GH-9102) 2018-09-07 18:13:10 +02:00
Victor Stinner 886483e2b9
bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)
* Add %T format to PyUnicode_FromFormatV(), and so to
  PyUnicode_FromFormat() and PyErr_Format(), to format an object type
  name: equivalent to "%s" with Py_TYPE(obj)->tp_name.
* Replace Py_TYPE(obj)->tp_name with %T format in unicodeobject.c.
* Add unit test on %T format.
* Rename unicode_fromformat_write_cstr() to
  unicode_fromformat_write_utf8(), to make the intent more explicit.
2018-09-07 18:00:58 +02:00
Pablo Galindo 254a4663d8
bpo-20104: Add flag capabilities to posix_spawn (GH-6693)
Implement the "attributes objects" parameter of `os.posix_spawn` to complete the implementation and fully cover the underlying API.
2018-09-07 16:44:24 +01:00
Victor Stinner 5e922658fb
bpo-34605: Avoid master/slave terms (GH-9101)
* Replace "master process" with "parent process"
* Replace "master option mappings" with "main option mappings"
* Replace "master pattern object" with "main pattern object"
* ssl: replace "master" with "server"
* And some other similar changes
2018-09-07 17:30:33 +02:00
Victor Stinner 012f5b968a
bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)
Rename also run_tests_slave() to run_tests_worker().
2018-09-07 17:20:42 +02:00
William Grzybowski 23e65b2555 bpo-33625: Release GIL for grp.getgr{nam,gid} and pwd.getpw{nam,uid} (GH-7081)
Release GIL on grp.getgrnam(), grp.getgrgid(), pwd.getpwnam() and
pwd.getpwuid() if reentrant variants of these functions are available.

Patch by William Grzybowski.
2018-09-07 14:06:15 +02:00
Julien Palard 25fa141487 Doc: Missing 'f' in an f-string. (GH-9074) 2018-09-07 11:31:47 +02:00
Sergey Fedoseev f9925d86c9 _sre.c: Removed unused SRE_IS_ALNUM macro (GH-9090) 2018-09-07 10:56:09 +02:00
jdemeyer 8f735485ac bpo-25750: fix refcounts in type_getattro() (GH-6118)
When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
2018-09-07 09:37:00 +02:00
Sergey Fedoseev 593bb30e82 closes bpo-34599: Improve performance of _Py_bytes_capitalize(). (GH-9083) 2018-09-06 21:54:49 -07:00
Zackery Spytz b03c2c5190 closes bpo-34594: Don't hardcode errno values in the tests. (GH-9076) 2018-09-06 11:43:30 -07:00
Tal Einat 3e2b29dccc
bpo-30977: make uuid.UUID use __slots__ (GH-9078)
Co-Authored-By: Wouter Bolsterlee.
2018-09-06 14:34:25 +03:00
Erik Janssens 874809ea38 closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067) 2018-09-04 23:29:42 -07:00
Brendan Gerrity 3876af4f7c bpo-34565: Change a PC/launcher.c comment to accurately describe valid major versions. (GH-9037) 2018-09-04 09:35:46 -07:00
Alexander Buchkovsky 266f4904a2 bpo-34563: Fix for invalid assert on big output of multiprocessing.Process (GH-9027)
Fix for invalid assert on big output of multiprocessing.Process.
2018-09-04 18:10:28 +02:00
Serhiy Storchaka 7917aadb3e
bpo-26544: Add test for platform._comparable_version(). (GH-8973) 2018-09-04 15:04:25 +03:00
Victor Stinner 39487196c8
bpo-34530: Fix distutils find_executable() (GH-9049)
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
2018-09-04 11:01:09 +02:00
Pablo Galindo ec74d187f5 bpo-33613, test_semaphore_tracker_sigint: fix race condition (#7850)
Fail `test_semaphore_tracker_sigint` if no warnings are expected and one is received.

Fix race condition when the child receives SIGINT before it can register signal handlers for it.

The race condition occurs when the parent calls
`_semaphore_tracker.ensure_running()` (which in turn spawns the
semaphore_tracker using `_posixsubprocess.fork_exec`), the child
registers the signal handlers and the parent tries to kill the child.
What seem to happen is that in some slow systems, the parent sends the
signal to kill the child before the child protects against the signal.
2018-09-04 10:53:54 +02:00
Pablo Galindo e9ba3705de
bpo-33083 - Make math.factorial reject arguments that are not int-like (GH-6149)
math.factorial() was accepting non-integral Decimal instances. This is inconsistent with the actual behaviour for floats, which are not accepted.
2018-09-03 22:20:06 +01:00
Victor Stinner 65fc98e7b1
bpo-26901: Fix the Argument Clinic test suite (GH-8879)
* Fix Tools/clinic/clinic_test.py: add missing
  FakeClinic.destination_buffers attribute and pass a file argument
  to Clinic().
* Rename Tools/clinic/clinic_test.py to Lib/test/test_clinic.py:
  add temporary Tools/clinic/ to sys.path to import the clinic
  module.

Co-Authored-By: Pablo Galindo <pablogsal@gmail.com>
2018-09-03 23:17:20 +02:00
Victor Stinner 73b00becbd
bpo-34544: pymain_read_conf() don't change LC_ALL (GH-9045)
bpo-34485, bpo-34544: Again, pymain_read_conf() leaves LC_ALL locale
unchanged: only modify LC_CTYPE.
2018-09-03 17:32:31 +02:00
Victor Stinner 2094c2bea4
bpo-34567: pythoninfo gets coreconfig (GH-9043)
* Add _testcapi.get_coreconfig() to get the _PyCoreConfig of the
  interpreter
* test.pythoninfo now gets the core configuration using
  _testcapi.get_coreconfig()
2018-09-03 17:06:39 +02:00