Commit Graph

102746 Commits

Author SHA1 Message Date
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
Miss Islington (bot) 8b30ee8435 bpo-36650: Fix handling of empty keyword args in C version of lru_cache. (GH-12881) (GH-12888)
(cherry picked from commit 14adbd4598)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-04-20 07:50:32 -10:00
Miss Islington (bot) d29b3dd922
bpo-36651: Fixed Asyncio Event Loop documentation inconsistency (GH-12866)
GH- [bpo-36651](https://bugs.python.org/issue36651): Fixed Asyncio Event Loop documentation inconsistency

In the documentation for the call_later and the call_at methods there is a note which says that the delay cannot be longer than a day, but both methods have a note saying that this limitation was removed in Python 3.8
Here I fixed this issue by removing the pre-exising note and added a versionchanged.

To test my changes I have rebuilt the documentation with ```make html```. I did not have any errors and the effected page displayed correctly on a browser.

https://bugs.python.org/issue36651
(cherry picked from commit 7e954e7de4)

Co-authored-by: Enrico Alarico Carbognani <enrico.carbognani@gmail.com>
2019-04-18 05:49:24 -07:00
Miss Islington (bot) 21c8caa16a
Fix wrong indentation of a paragraph in documentation (GH-12868)
This paragraph doesn't seem to be a part of code, but merged into previous code block.
(cherry picked from commit 9941f963fe)

Co-authored-by: cocoatomo <cocoatomo77@gmail.com>
2019-04-17 18:00:37 -07:00
Miss Islington (bot) 0d4f16d283
bpo-36649: Remove trailing spaces for registry keys when installed via the Store (GH-12865)
(cherry picked from commit 4c3efd9cd0)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-04-17 14:52:14 -07:00
Victor Stinner 394b991e41
[3.7] bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12862)
* bpo-35755: shutil.which() uses os.confstr("CS_PATH") (GH-12858)

shutil.which() and distutils.spawn.find_executable() now use
os.confstr("CS_PATH") if available instead of os.defpath, if the PATH
environment variable is not set.

Don't use os.confstr("CS_PATH") nor os.defpath if the PATH
environment variable is set to an empty string.

Changes:

* find_executable() now starts by checking for the executable in the
  current working directly case. Add an explicit
  "if not path: return None".
* Add tests for PATH='' (empty string), PATH=':' and for PATHEXT.

(cherry picked from commit 228a3c99bd)

* bpo-35755: Remove current directory from posixpath.defpath (GH-11586)

Document the change in a NEWS entry of the Security category.

(cherry picked from commit 2c4c02f8a8)
2019-04-17 18:38:06 +02:00
Miss Islington (bot) b87a8073db bpo-32849: Fix is_valid_fd() on FreeBSD (GH-12852) (GH-12863)
Fix Python Initialization code on FreeBSD to detect properly when
stdin file descriptor (fd 0) is invalid.

On FreeBSD, fstat() must be used to check if stdin (fd 0) is valid.
dup(0) doesn't fail if stdin is invalid in some cases.
(cherry picked from commit 3092d6b263)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-17 18:30:27 +02:00
Miss Islington (bot) a6fce19968 bpo-33783: Use proper class markup for random.Random docs (GH-7817) (GH-12859)
Signed-off-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
(cherry picked from commit 31e8d69bfe)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2019-04-16 23:32:32 +02:00
Miss Islington (bot) cd46b09b08 bpo-36508: python-config don't export LINKFORSHARED (GH-12661) (GH-12748)
python-config --ldflags no longer includes flags of the LINKFORSHARED
variable. The LINKFORSHARED variable must only be used to build
executables.
(cherry picked from commit e65f01f78d)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-16 15:01:33 +02:00
Victor Stinner 2815bf5b1f
bpo-36348: test_imaplib: add debug info (GH-12846)
Log more info if tests fail.
2019-04-15 18:45:01 +02:00
Miss Islington (bot) 871ba6c848
Doc: update PendingDeprecationWarning explanation (GH-12837)
Keep the nudge towards DeprecationWarning, but remove the
"Note" markup and generally shorten the description.

Ref: https://github.com/python/cpython/pull/12505/filesGH-r273978757
(cherry picked from commit a3283efd30)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-04-15 05:48:31 -07:00
Miss Islington (bot) 28ed39e83e bpo-36629: Add support.get_socket_conn_refused_errs() (GH-12834) (GH-12835)
Fix test_imap4_host_default_value() of test_imaplib: catch also
errno.ENETUNREACH error.
(cherry picked from commit 3c7931e514)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-15 12:49:37 +02:00
Miss Islington (bot) 9f9e029bd2
bpo-16079: fix duplicate test method name in test_gzip. (GH-12827)
(cherry picked from commit cd466559c4)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-04-14 10:50:52 -07:00
Pablo Galindo 7723d0545c
[3.7] bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure can terminate the calling thread (GH-12541) (GH-12820)
Calling these function from a thread when the runtime is finalizing will terminate
the thread, even if the thread was not created by Python. Users can use
_Py_IsFinalizing or sys.is_finalizing to check if the interpreter is in the process of
being finalized before calling this function to avoid unwanted termination.
(cherry picked from commit fde9b33)
2019-04-14 03:49:17 +01:00
Miss Islington (bot) f3a9d722d7
bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing (GH-12790)
In Python having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. This is due to the usage of super() in some class methods, as this sets the __class__ attribute. To avoid this, as a workaround, alias the usage of super .
(cherry picked from commit 830b43d03c)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-04-13 12:31:58 -07:00
Miss Islington (bot) d28aaa7df8
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
(cherry picked from commit 46544f69bf)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-04-13 09:25:20 -07:00
Miss Islington (bot) be63df287a
Doc: define PY_SSIZE_T_CLEAN always (GH-12794)
(cherry picked from commit c88feceb44)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-04-12 18:56:50 -07:00
Victor Stinner 5403006c5c
bpo-36605: make tags: parse Modules/_io directory (GH-12789) (GH-12814)
"make tags" and "make TAGS" now also parse Modules/_io/*.c
and Modules/_io/*.h.

(cherry picked from commit 21a74a9d77)
2019-04-13 02:50:31 +02:00
Miss Islington (bot) b759a2c5b9
bpo-35581: Document @typing.type_check_only (GH-11312)
(cherry picked from commit 1e8295402b)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2019-04-12 15:47:57 -07:00
Miss Islington (bot) 395bb94a7f
bpo-33922: Adding documentation for new "-64" suffix of Python launcher (GH-7849)
Since bpo-30291 it is possible to specify the architecture of Python when using the launcher
(cherry picked from commit 1e2ad6c275)

Co-authored-by: mrh1997 <mrh1997@users.noreply.github.com>
2019-04-12 15:32:33 -07:00
Miss Islington (bot) c05c1165ab
Allow Windows layout builds to fully skip code signing (GH-12808)
(cherry picked from commit 606c66a17f)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-04-12 11:44:00 -07:00
Miss Islington (bot) 7182e653fb
bpo-36611: Fix test_sys.test_getallocatedblocks() (GH-12797)
Fix test_sys.test_getallocatedblocks() when tracemalloc is enabled.
If the name of Python memory allocators cannot get read, consider
that pymalloc is disabled.

Fix the following error:

./python -X tracemalloc -m test test_sys -v -m test_getallocatedblocks

ERROR: test_getallocatedblocks (test.test_sys.SysModuleTest)
------------------------------------------------------------
Traceback (most recent call last):
  File "Lib/test/test_sys.py", line 770, in test_getallocatedblocks
    alloc_name = _testcapi.pymem_getallocatorsname()
RuntimeError: cannot get allocators name
(cherry picked from commit 9b8314cfe2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-12 06:33:31 -07:00
Miss Islington (bot) a910c2c6f3
bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest (GH-9736)
(cherry picked from commit 0522fd81dc)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2019-04-11 23:27:27 -07:00
Victor Stinner 9e23f0a27c
[3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) (GH-12788)
* bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770)

Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline
function. The function is now way more efficient, it became a simple
comparison on integers, rather than a short loop. It detects also
uninitialized bytes and "forbidden bytes" filled by debug hooks
on memory allocators.

Add unit tests on _PyObject_IsFreed().

(cherry picked from commit 2b00db6855)

* bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782)

Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD,
0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte
patterns than Windows CRT debug malloc() and free().

(cherry picked from commit 4c409beb4c)
2019-04-11 22:30:31 +02:00
Inada Naoki ac31da8f37
bpo-36597: fix random doctest failure (GH-12778) 2019-04-11 19:37:53 +09:00
Miss Islington (bot) 04b114eede
bpo-36416: Correct bytes.rpartition documentation (GH-12543)
(cherry picked from commit efc4870149)

Co-authored-by: pewscorner <pewscorner@users.noreply.github.com>
2019-04-11 03:18:48 -07:00
Miss Islington (bot) a8c4fa5319
Doc: fix typo in IncrementalDecoder.setstate (GH-12724)
(cherry picked from commit b5e2959b27)

Co-authored-by: Christopher Thorne <libcthorne@users.noreply.github.com>
2019-04-10 23:18:07 -07:00
Miss Islington (bot) 59fd08c25c
better __init__.py explanation in tutorial (GH-12763)
* better __init__.py explanation in tutorial

* Update Doc/tutorial/modules.rst

Co-Authored-By: methane <songofacandy@gmail.com>
(cherry picked from commit 5410d3d283)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-04-10 23:16:34 -07:00
Miss Islington (bot) d9b25a2627
bpo-36235: Fix distutils test_customize_compiler() on macOS (GH-12764)
Set CUSTOMIZED_OSX_COMPILER to True to disable
_osx_support.customize_compiler().
(cherry picked from commit a9bd8925c7)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-10 16:58:55 -07:00
Miss Islington (bot) 9d2ccf173e
bpo-14826: document that URLopener quotes fullurl. (GH-12758)
(cherry picked from commit 2fb2bc81c3)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-04-10 02:30:22 -07:00
Miss Islington (bot) 796698adf5
bpo-12910: update and correct quote docstring (GH-2568)
Fixes some mistakes and misleadings in the quote function docstring:
- reserved chars are never actually used by quote code, unreserved chars are
- reserved chars were wrong and incomplete
- mentioned that use-case is not minimal quoting wrt. RFC, but cautious quoting
(cherry picked from commit 750d74fac5)

Co-authored-by: Jörn Hees <joernhees@users.noreply.github.com>
2019-04-09 17:53:03 -07:00
Victor Stinner 86f0354fcb
[3.7] bpo-36560: regrtest: don't collect the GC twice (GH-12747) (GH-12749)
* bpo-36560: Fix reference leak hunting in regrtest (GH-12744)

Fix reference leak hunting in regrtest: compute also deltas (of
reference count, allocated memory blocks, file descriptor count)
during warmup, to ensure that everything is initialized before
starting to hunt reference leaks.

Other changes:

* Replace gc.collect() with support.gc_collect()
* Move calls to read memory statistics from dash_R_cleanup() to
  dash_R()
* Pass regrtest 'ns' to dash_R()
* dash_R() is now more quiet with --quiet option (don't display
  progress).
* Precompute the full range for "for it in range(repcount):" to
  ensure that the iteration doesn't allocate anything new.
* dash_R() now is responsible to call warm_caches().

(cherry picked from commit 5aaac94eeb)

* bpo-36560: regrtest: don't collect the GC twice (GH-12747)

dash_R() function of libregrtest doesn't call support.gc_collect()
directly anymore: it's already called by dash_R_cleanup().

Call dash_R_cleanup() before starting the loop.

(cherry picked from commit bb4447897a)
2019-04-09 18:55:50 +02:00
Miss Islington (bot) 0a16bb15af
closes bpo-35848: Move all documentation regarding the readinto out of IOBase. (GH-11893)
Move all documentation regarding the readinto method into either io.RawIOBase or io.BufferedIOBase.

Corresponding changes to documentation in the _pyio.py module.
(cherry picked from commit 7b97ab35b2)

Co-authored-by: Steve Palmer <steve@srpalmer.me.uk>
2019-04-08 21:57:31 -07:00
Miss Islington (bot) 2368d86ed1 bpo-36565: Fix libregrtest for Python without builtin _abc (GH-12733) (GH-12734)
Fix reference hunting (``python3 -m test -R 3:3``) when Python has no
built-in abc module: fix _get_dump() reimplementation of libregrtest.
(cherry picked from commit 79b5d29041)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-04-09 01:54:16 +02:00
Miss Islington (bot) 1f0ff57acb
Correct "inplace" with "in-place" (GH-10480)
(cherry picked from commit f4efa312d1)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2019-04-08 02:21:38 -07:00
Miss Islington (bot) a9a065addd
bpo-9883: Update list of unimplemented interfaces in minidom. (GH-12677)
Remove names from the "unimplemented interfaces" list
in the minidom docs that are actually implemented.
(cherry picked from commit 2ea8099523)

Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
2019-04-07 19:55:58 -07:00
Miss Islington (bot) 1bc6cd7066
Fix doc for create_subprocess_exec (GH-12598)
Add missing `program` argument to asyncio.create_subprocess_exec documentation.
(cherry picked from commit 1328375ad1)

Co-authored-by: Dima Tisnek <dimaqq@gmail.com>
2019-04-05 07:08:31 -07:00
Miss Islington (bot) 86fbe0287d
bpo-36404: recommend DeprecationWarning over PendingDeprecationWarning (GH-12505)
(cherry picked from commit 176d26364b)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-04-05 02:07:21 -07:00
Miss Islington (bot) 6f9cd142a2 bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682)
(cherry picked from commit 461c416dd7)

Co-authored-by: Matt Houglum <houglum@google.com>
2019-04-04 11:25:59 +03:00
Pablo Galindo 513d142993
[3.7] bpo-36440: include node names in ParserError messages, instead of numeric IDs (GH-12565) (GH-12671)
The error messages in the parser module are referring to numeric IDs for the nodes. To improve readability, use the node names when reporting errors..
(cherry picked from commit cb0748d393)

Co-authored-by: tyomitch <tyomitch@gmail.com>
2019-04-03 14:34:59 -04:00
Miss Islington (bot) 9c08eeb30c
bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). (GH-12660)
(cherry picked from commit 487b73ab39)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-04-03 10:55:26 -07:00
Miss Islington (bot) ef516d11c1
bpo-32413: Add documentation that at the module level, locals(), globals() are the same dictionary (GH-5004)
https://bugs.python.org/issue32413
(cherry picked from commit 1c5fa5af8a)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2019-04-02 11:14:50 -07:00
Miss Islington (bot) 9a838c593f
bpo-35838: document optionxform must be idempotent (GH-12656)
(cherry picked from commit 04694a306b)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-04-02 02:29:16 -07:00
Miss Islington (bot) 5ca4fe0478
bpo-13120: fix typo with test_issue13120() method name (GH-12250)
Incorrect issue number '13210' added in 539ee5da6f.

https://bugs.python.org/issue13120
(cherry picked from commit 9139f926a8)

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-04-02 01:17:25 -07:00
Miss Islington (bot) 85730b84fb
Temporary workaround for an ACL issue on Ubuntu on Azure Pipelines (GH-12649)
(cherry picked from commit b4bcefe5fe)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2019-04-01 09:30:58 -07:00
Miss Islington (bot) 35fc38e5e8
bpo-36157:Document PyInterpreterState_Main() (GH-12238)
I have added documentation for `PyInterpreterState_Main()`.
 I chose to place it under Advanced Debugger Support together with similar functions like `PyInterpreterState_Head()`, `PyInterpreterState_Next(`), and `PyInterpreterState_ThreadHead()` .

https://bugs.python.org/issue36157
(cherry picked from commit 8c61739def)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2019-04-01 08:15:10 -07:00