Commit Graph

102841 Commits

Author SHA1 Message Date
Gregory P. Smith 3b4b28efbd
[3.7] bpo-36533: Reinit logging.Handler locks on fork(). (GH-12704) (GH-13170)
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.
(cherry picked from commit 64aa6d2000)

Co-authored-by: Gregory P. Smith <greg@krypto.org>  [Google LLC]
2019-05-07 16:29:41 -04:00
Miss Islington (bot) 299f69c24c
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
(cherry picked from commit b35acc5b3a)

Co-authored-by: Romain Picard <romain.picard@oakbits.com>
2019-05-07 12:38:00 -07:00
Miss Islington (bot) 19ca5b500a
bpo-31922: Do not connect UDP sockets when broadcast is allowed (GH-423)
*Moved from python/asyncioGH-493.*

This PR fixes issue python/asyncioGH-480, as explained in [this comment](https://github.com/python/asyncio/issues/480GH-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
(cherry picked from commit 63deaa5b70)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
2019-05-07 10:45:53 -07:00
Miss Islington (bot) 1fe722cf14
[3.7] bpo-11001: updated cookie docs (GH-13086) (GH-13161)
Used **spookylukey**'s patch from 2011-01-24



https://bugs.python.org/issue11001
(cherry picked from commit 91cc01f40e)


Co-authored-by: Julia Iliuk <julia.iluyk@gmail.com>


https://bugs.python.org/issue11001
2019-05-07 10:32:45 -07:00
Miss Islington (bot) 721729fca4
bpo-28795: Signal documentation: Fix misleading statement. (GH-13121)
(cherry picked from commit e85ef7a7ea)

Co-authored-by: Julien Palard <julien@palard.fr>
2019-05-07 08:55:39 -07:00
Miro Hrončok 7e200e0763 bpo-30458: Disallow control chars in http URLs. (GH-12755) (GH-13154)
Disallow control chars in http URLs in urllib.urlopen.  This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.

Disable https related urllib tests on a build without ssl (GH-13032)
These tests require an SSL enabled build. Skip these tests when python is built without SSL to fix test failures.

Use http.client.InvalidURL instead of ValueError as the new error case's exception. (GH-13044)

Backport Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
2019-05-07 11:28:47 -04:00
Miss Islington (bot) 146010ea42
bpo-36783: Added C API Documentation for Time_FromTimeAndFold and PyDateTime_FromDateAndTimeAndFold (GH-13147)
(cherry picked from commit 5765ecf79f)

Co-authored-by: Edison A <20975616+SimiCode@users.noreply.github.com>
2019-05-07 08:17:50 -07:00
Miss Islington (bot) a6516f89aa bpo-31855: unittest.mock.mock_open() results now respects the argument of read([size]) (GH-11521) (#13152)
unittest.mock.mock_open() results now respects the argument of read([size])

Co-Authored-By: remilapeyre <remi.lapeyre@henki.fr>
(cherry picked from commit 11a8832c98)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
2019-05-07 13:34:48 +01:00
Miss Islington (bot) ffa29b5aca
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.
(cherry picked from commit 2cc0223f43)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-05-06 20:51:25 -07:00
penguindustin b2d29bfa5b [3.7] bpo-36766: Typos in docs and code comments (GH-13116). (GH-13136)
(cherry picked from commit 9646630895)

Co-authored-by: penguindustin <penguindustin@gmail.com>





https://bugs.python.org/issue36766
2019-05-06 13:55:19 -07:00
Miss Islington (bot) 88a2074e3b
[3.7] Clarify the download unit in the download section (GH-13122) (GH-13130)
(cherry picked from commit e9b49d1b4e)


Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2019-05-06 12:32:52 -07:00
Miss Islington (bot) 9a03c77328
bpo-36275: enhance documentation for venv.create() (GH-13114)
(cherry picked from commit 3921b1cc34)

Co-authored-by: Sebastian Koslowski <sebastian.koslowski@gmail.com>
2019-05-06 12:25:59 -07:00
Miss Islington (bot) 8777915ade
bpo-30668: add missing word in license.rst (GH-13115)
(cherry picked from commit 4920c093da)

Co-authored-by: Patrick Mühlbauer <tmuxbiene@googlemail.com>
2019-05-06 12:08:10 -07:00
Miss Islington (bot) 905ce9eeb1
simplify StartupImportTests (GH-13096)
_osx_support and copyreg are not imported from site on macOS for now.
(cherry picked from commit c4d92c8ada)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-05-05 02:25:16 -07:00
Miss Islington (bot) 2b5ffc02c0 bpo-36189: Fixing typo in tutorial introduction (GH-13093)
(cherry picked from commit 98a1e06c47)

Co-authored-by: Jonatan <jonyucra@gmail.com>
2019-05-04 23:22:34 -04:00
Miss Islington (bot) 37125ff6e2 bpo-36166: Change to rst datamodel file. (GH-13089) (#13094)
(cherry picked from commit 5e98f05e55)

Co-authored-by: Catherine Alvarado <catherine@qventus.com>
2019-05-04 23:21:28 -04:00
Miss Islington (bot) 769ac7e7b8
bpo-36613: call remove_done_callback if exception (GH-12800)
Call remove_done_callback() in finally block.

https://bugs.python.org/issue36613
(cherry picked from commit c1964e9e21)

Co-authored-by: gescheit <gescheit12@gmail.com>
2019-05-03 08:35:52 -07:00
Miss Islington (bot) 128e2262a8
bpo:34848 : Correct an incorrect docstring for range().index method (GH-9877)
(cherry picked from commit 22c526394b)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2019-05-03 05:39:17 -07:00
Terry Jan Reedy 304ca211c4
[3.7] bpo-34162: Fix idlelib/NEWS.text for 3.7.4 (#13067) 2019-05-02 15:34:01 -04:00
Miss Islington (bot) e85ba1e692 [3.7] bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026) (GH-13060)
(cherry picked from commit c4e78b116f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-05-02 15:29:06 -04:00
Miss Islington (bot) 3f8f64ebf3 bpo-35726: Add test for QueueHandler with multiple handlers (GH-11659) (GH-13061)
(cherry picked from commit 2dad96013c)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-05-02 13:24:01 -04:00
Xtreak 386b6f07a9 [3.7] bpo-35726: Prevented QueueHandler formatting from affecting other handlers (GH-11537) (GH-12716)
QueueHandler.prepare() now makes a copy of the record before modifying and enqueueing it, to avoid affecting other handlers in the chain.
(cherry picked from commit da6424e96a)

Co-authored-by: Manjusaka <lizheao940510@gmail.com>
2019-05-02 13:02:42 -04:00
Miss Islington (bot) 0ff08b061b
Change bisect to bisect_cmd in docstring (GH-13040)
(cherry picked from commit 11e4a941e9)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-05-01 20:10:12 -07:00
Miss Islington (bot) 47ffc1a9f6 bpo-27682: Handle client connection terminations in wsgiref (GH-9713)
(cherry picked from commit 3d37ea25dc)

Co-authored-by: Petter Strandmark <petter.strandmark@gmail.com>
2019-05-01 20:52:40 +03:00
Miss Islington (bot) 5f5b187bfa
bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)
Initialize "stack_t current_stack" to zero using memset().
(cherry picked from commit b84cb70880)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-30 14:30:44 -07:00
Miss Islington (bot) 4d723e76e1
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017)
(cherry picked from commit d537ab0ff9)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-04-30 05:21:02 -07:00
Miss Islington (bot) 4b5340bb63
closes bpo-35329: Change 'Package' to 'package' in accordance with PEP8. (GH-13008)
(cherry picked from commit ee0309f3d8)

Co-authored-by: Utkarsh Gupta <guptautkarsh2102@gmail.com>
2019-04-29 19:26:00 -07:00
Miss Islington (bot) 52a5b71063
bpo-34602: Avoid failures setting macOS stack resource limit (GH-13011)
Under some conditions the earlier fix for bpo-18075, "Infinite recursion
tests triggering a segfault on Mac OS X", now causes failures on macOS
when attempting to change stack limit with resource.setrlimit
resource.RLIMIT_STACK, like regrtest does when running the test suite.
The reverted change had specified a non-default stack size when linking
the python executable on macOS.  As of macOS 10.14.4, the previous
code causes a hard failure when running tests, although similar
failures had been seen under some conditions under some earlier
systems.  For now, revert the original change and resume using
the default stack size when linking the interpreter.
(cherry picked from commit 883dfc668f)

Co-authored-by: Ned Deily <nad@python.org>
2019-04-29 12:27:36 -07:00
Victor Stinner 5e09a9973b
bpo-35952: Sync test.pythoninfo from master (GH-13009) 2019-04-29 15:20:27 +02:00
Miss Islington (bot) 896c6357f3
bpo-36745: Fix a possible reference leak in PyObject_SetAttr() (GH-12993)
https://bugs.python.org/issue36745
(cherry picked from commit e0dcb85b7d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-04-28 06:17:40 -07:00
Miss Islington (bot) f5972cc0c9 bpo-2091: Fix typo in exception message (GH-12987)
(cherry picked from commit 21a9ba1992)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2019-04-27 23:39:06 +03:00
Miss Islington (bot) 5d90954856
Syntax highlight IDLE html doc code example. (GH-12981)
The new markup is currently ignored by IDLE's tk doc display.
(cherry picked from commit 55d035113d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-04-26 20:42:05 -07:00
Ivan Levkivskyi d111490a1f
[3.7] bpo-36679: Rename duplicate test_class_getitem function (GH-12892) (GH-12978)
(cherry picked from commit d437012cdd)

Co-authored-by: Windson yang <wiwindson@outlook.com>
2019-04-26 18:21:45 -07:00
Miss Islington (bot) 967f14ec2a
bpo-31525: Increase minimum sqlite version number check (GH-12923)
(cherry picked from commit ad0daf5b37)

Co-authored-by: Charles Pigott <charlespigott@googlemail.com>
2019-04-26 09:15:31 -07:00
Victor Stinner 1069d38fa1
[3.7] bpo-36719: sync regrtest with master branch (GH-12967)
* Clean up code which checked presence of os.{stat,lstat,chmod} (GH-11643)

(cherry picked from commit 8377cd4fcd)

* bpo-36725: regrtest: add TestResult type (GH-12960)

* Add TestResult and MultiprocessResult types to ensure that results
  always have the same fields.
* runtest() now handles KeyboardInterrupt
* accumulate_result() and format_test_result() now takes a TestResult
* cleanup_test_droppings() is now called by runtest() and mark the
  test as ENV_CHANGED if the test leaks support.TESTFN file.
* runtest() now includes code "around" the test in the test timing
* Add print_warning() in test.libregrtest.utils to standardize how
  libregrtest logs warnings to ease parsing the test output.
* support.unload() is now called with abstest rather than test_name
* Rename 'test' variable/parameter to 'test_name'
* dash_R(): remove unused the_module parameter
* Remove unused imports

(cherry picked from commit 4d29983185)

* bpo-36725: Refactor regrtest multiprocessing code (GH-12961)

Rewrite run_tests_multiprocess() function as a new MultiprocessRunner
class with multiple methods to better report errors and stop
immediately when needed.

Changes:

* Worker processes are now killed immediately if tests are
  interrupted or if a test does crash (CHILD_ERROR): worker
  processes are killed.
* Rewrite how errors in a worker thread are reported to
  the main thread. No longer ignore BaseException or parsing errors
  silently.
* Remove 'finished' variable: use worker.is_alive() instead
* Always compute omitted tests. Add Regrtest.get_executed() method.

(cherry picked from commit 3cde440f20)

* bpo-36719: regrtest always detect uncollectable objects (GH-12951)

regrtest now always detects uncollectable objects. Previously, the
check was only enabled by --findleaks. The check now also works with
-jN/--multiprocess N.

--findleaks becomes a deprecated alias to --fail-env-changed.

(cherry picked from commit 75120d2205)

* bpo-34060: Report system load when running test suite for Windows (GH-8357)

While Windows exposes the system processor queue length, the raw value
used for load calculations on Unix systems, it does not provide an API
to access the averaged value. Hence to calculate the load we must track
and average it ourselves. We can't use multiprocessing or a thread to
read it in the background while the tests run since using those would
conflict with test_multiprocessing and test_xxsubprocess.

Thus, we use Window's asynchronous IO API to run the tracker in the
background with it sampling at the correct rate. When we wish to access
the load we check to see if there's new data on the stream, if there is,
we update our load values.


(cherry picked from commit e16467af0b)

* bpo-36719: Fix regrtest re-run (GH-12964)

Properly handle a test which fail but then pass.

Add test_rerun_success() unit test.

(cherry picked from commit 837acc1957)

* bpo-36719: regrtest closes explicitly WindowsLoadTracker (GH-12965)

Regrtest.finalize() now closes explicitly the WindowsLoadTracker
instance.

(cherry picked from commit 00db7c73af)
2019-04-26 12:16:30 +02:00
Miss Islington (bot) 3076a3e0d1 bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) (GH-12948)
bpo-28552, bpo-7774: Fix distutils.sysconfig if sys.executable is
None or an empty string: use os.getcwd() to initialize project_base.

Fix also the distutils build command: don't use sys.executable if
it's evaluated as false (None or empty string).
(cherry picked from commit 0ef8c157e9)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-25 13:15:47 +02:00
Miss Islington (bot) 4d0233ec65 bpo-30840: Document relative imports (GH-12831) (GH-12938)
* Document relative imports
(cherry picked from commit 70bf713617)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2019-04-25 01:44:19 +10:00
Miss Islington (bot) e1a6cf2824
bpo-36454: Fix test_time.test_monotonic() (GH-12929)
Change test_time.test_monotonic() to test only the lower bound of elapsed time
after a sleep command rather than the upper bound. This prevents unnecessary
test failures on slow buildbots. Patch by Victor Stinner.
(cherry picked from commit d246a6766b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-23 15:35:55 -07:00
Miss Islington (bot) e64d21b187
replace 'sequencial argument' by 'positional' in doc (GH-12925)
(cherry picked from commit 29d018aa63)

Co-authored-by: Mathieu Dupuy <deronnax@users.noreply.github.com>
2019-04-23 06:06:57 -07:00
Miss Islington (bot) c0f6f53703
bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)
(cherry picked from commit 359bd4f61b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-04-23 05:18:15 -07:00
Victor Stinner 8a9a6b443c
[3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920)
* bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010)

Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t.

(cherry picked from commit edad38e3e0)

* bpo-30465: Fix C downcast warning on Windows in ast.c (#6593)

ast.c: fstring_fix_node_location() downcasts a pointer difference to
a C int. Replace int with Py_ssize_t to fix the compiler warning.

(cherry picked from commit fb7e7992be)

* bpo-9566: Fix compiler warnings in peephole.c (GH-10652)

(cherry picked from commit 028f0ef4f3)

* bpo-27645, sqlite: Fix integer overflow on sleep (#6594)

Use the _PyTime_t type and round away from zero (ROUND_UP,
_PyTime_ROUND_TIMEOUT) the sleep duration, when converting a Python
object to seconds and then to milliseconds. Raise an OverflowError in
case of overflow.

Previously the (int)double conversion rounded towards zero
(ROUND_DOWN).

(cherry picked from commit ca405017d5)
2019-04-23 10:26:11 +02:00
Miss Islington (bot) 9344d74f7b
Fixes platform.win32_ver on non-Windows platforms (GH-12912)
(cherry picked from commit d307d05350)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-04-22 11:59:08 -07:00
Miss Islington (bot) 36aecc0079
bpo-36672: Fix a compiler warning in winreg.SetValue() (GH-12882)
(cherry picked from commit 34366b7f91)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-04-22 10:31:46 -07:00
Miss Islington (bot) 7038deed09
bpo-9194: Fix the bounds checking in winreg.c's fixupMultiSZ() (GH-12687)
(cherry picked from commit 56ed86490c)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-04-22 10:20:33 -07:00
Miss Islington (bot) 5407aaf18b bpo-36690: Fix typo in Tools/demo/rpython.py (GH-12903)
(cherry picked from commit d59b662e49)

Co-authored-by: 周家未 <752736341@qq.com>
2019-04-22 16:53:53 +03:00
Marcin Niemira 1100ae8f3f bpo-36523: Add docstring to io.IOBase.writelines (GH-12683)
(cherry picked from commit ab86521a9d)
2019-04-22 21:08:24 +09:00
Miss Islington (bot) 8c49d71385
Doc: add the missing ".tp_flags" in type definition (GH-12902)
(cherry picked from commit 662ebd2ab2)

Co-authored-by: Wu Wei <weiwu@cacheme.net>
2019-04-22 04:14:25 -07:00
Berker Peksag 15a57a3cad
bpo-23078: Add support for {class,static}method to mock.create_autospec() (GH-11613)
Co-authored-by: Felipe <felipe.nospam.ochoa@gmail.com>

(cherry picked from commit 9b21856b0f)
2019-04-22 06:07:56 +03:00
Miss Islington (bot) 71b88827f6
bpo-36645: Fix ambiguous formatting in re.sub() documentation (GH-12879)
(cherry picked from commit 5ebfa840a1)

Co-authored-by: mollison <mollison@cs.unc.edu>
2019-04-21 15:20:45 -07:00
Miss Islington (bot) 307e7a4264
Fix typo (GH-12878)
"sychronization" -> "synchronization"
(cherry picked from commit 3e986de0d6)

Co-authored-by: Fredrik Averpil <fredrik@averpil.com>
2019-04-20 16:12:23 -07:00