Commit Graph

105387 Commits

Author SHA1 Message Date
Sergey Fedoseev 755d4ef824 Correct overflow check in PyTuple_New() (GH-14838) 2019-09-09 13:40:58 -07:00
Serhiy Storchaka 832e864008
bpo-38049: Add command-line interface for the ast module. (GH-15724) 2019-09-09 23:36:13 +03:00
Lisa Roach b9f65f01fd
bpo-37383: Updates docs to reflect AsyncMock call_count after await. (#15761)
* bpo-351428: Updates documentation to reflect AsyncMock call_count after await.

* Adds skip and fixes warning.

* Removes extra >>>.

* Adds ... in front of await mock().
2019-09-09 17:54:13 +01:00
Vinay Sharma d14e39c8d9 bpo-38018: Increase code coverage for multiprocessing.shared_memory (GH-15662) 2019-09-09 11:48:55 -05:00
Greg Price 64c6ac74e2 bpo-36502: Update link to UAX #44, the Unicode doc on the UCD. (GH-15301)
The link we have points to the version from Unicode 6.0.0, dated 2010.
There have been numerous updates to it since then:
  https://www.unicode.org/reports/tr44/#Modifications

Change the link to one that points to the current version. Also, use HTTPS.
2019-09-09 09:37:13 -07:00
Serhiy Storchaka 850573b836
bpo-37995: Add an option to ast.dump() to produce a multiline output. (GH-15631) 2019-09-09 19:33:13 +03:00
Sergey Fedoseev 92709a263e bpo-37840: Fix handling of negative indices in bytearray_getitem() (GH-15250) 2019-09-09 09:28:34 -07:00
Christian Heimes 915cd3f069 bpo-35941: Fix performance regression in new code (GH-12610)
Accumulate certificates in a set instead of doing a costly list contain
operation. A Windows cert store can easily contain over hundred
certificates. The old code would result in way over 5,000 comparison
operations

Signed-off-by: Christian Heimes <christian@python.org>
2019-09-09 09:06:55 -07:00
Orivej Desh 09090d04ef bpo-37649: Fix exec_prefix check (GH-14897) 2019-09-09 09:05:21 -07:00
Hasan Ramezani fb6807b043 Fix punctuation in `os.execvpe` docstring. (GH-15051) 2019-09-09 08:58:21 -07:00
Anthony Sottile 370138ba9c bpo-35803: Document and test dir=PathLike for tempfile (GH-11644)
Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
2019-09-09 10:54:34 -05:00
Boris Verhovsky 9488a5289d Clarify that shutil's copy functions can accept path-like values (GH-15141) 2019-09-09 08:51:56 -07:00
Richard Sanger bb668f798a Fix docs bz.open default mode (GH-15100)
bz2.open()'s default mode is rb, not r
2019-09-09 08:49:47 -07:00
Zackery Spytz 682107cf45 bpo-36279: Ensure os.wait3() rusage is initialized (GH-15111)
Co-Authored-By: David Wilson <dw@botanicus.net>
2019-09-09 08:48:32 -07:00
Victor Stinner d91d4de317
bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782)
In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure
that the object is not freed. If it's freed, the program fails with
an assertion error and Python dumps informations about the freed
object.
2019-09-09 17:44:59 +02:00
Greg Price 3cbc23aa22 bpo-37758: Cut always-constant conditionals on sys.maxunicode. (GH-15302)
Since PEP 393 in Python 3.3, this value is always 0x10ffff, the
maximum codepoint in Unicode; there's no longer such a thing as a
UCS-2 build of Python, which couldn't properly represent some
characters.

There are a couple of spots left where we still condition on the value
of this constant.  Take them out.
2019-09-09 08:20:40 -07:00
Anthony Sottile 65366bc8bd bpo-20490: Improve circular import error message (GH-15308) 2019-09-09 08:17:50 -07:00
Antoine 88b24f96ae Minor changes in Doc/faq/library. (#15449)
* Minor changes.

* Update Doc/faq/library.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Apply suggestions from aeros167.

* Update Doc/faq/library.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>

* Apply suggestions from aeros167 + re-add a "a" that was accidentally deleted.
2019-09-09 17:00:43 +02:00
Victor Stinner a2af05a0d3
bpo-38006: Avoid closure in weakref.WeakValueDictionary (GH-15641)
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
2019-09-09 16:55:58 +02:00
Zeth b3b48c81f0 bpo-37876: Tests for ROT-13 codec (GH-15314)
The Rot-13 codec is for educational use but does not have unit tests,
dragging down test coverage. This adds a few very simple tests.
2019-09-09 07:50:36 -07:00
Mario Corchero f5e7f39d29 docs: Add references to AsyncMock in unittest.mock.patch (#13681)
Update the docs as patch can now return an AsyncMock if the patched
object is an async function.
2019-09-09 15:18:06 +01:00
Greg Price fa3a38d81f Mark files as executable that are meant as scripts. (GH-15354)
This is the converse of GH-15353 -- in addition to plenty of
scripts in the tree that are marked with the executable bit
(and so can be directly executed), there are a few that have
a leading `#!` which could let them be executed, but it doesn't
do anything because they don't have the executable bit set.

Here's a command which finds such files and marks them.  The
first line finds files in the tree with a `#!` line *anywhere*;
the next-to-last step checks that the *first* line is actually of
that form.  In between we filter out files that already have the
bit set, and some files that are meant as fragments to be
consumed by one or another kind of preprocessor.

    $ git grep -l '^#!' \
      | grep -vxFf <( \
          git ls-files --stage \
          | perl -lane 'print $F[3] if (!/^100644/)' \
        ) \
      | grep -ve '\.in$' -e '^Doc/includes/' \
      | while read f; do
          head -c2 "$f" | grep -qxF '#!' \
          && chmod a+x "$f"; \
        done
2019-09-09 07:16:33 -07:00
Alan Yee e3c59a7527 bpo-38059: Using sys.exit() over exit() in inspect.py (GH-15666)
Constants added by the site module like exit() "should not be used in programs"
2019-09-09 07:15:43 -07:00
Jon Janzen 24b11b8c95 bpo-38053 Update documentation for plistlib (GH-15727)
* Update documentation for plistlib

-  Update "Mac OS X" to "Apple" since plists are used more widely than just macOS
-  Re-add the UID class documentation (oops, removed in GH-15615)
2019-09-09 16:13:43 +02:00
Pablo Galindo c638521dbf
Fix typo in the algorithm description (GH-15774) 2019-09-09 15:08:23 +01:00
Naitree Zhu d5fd75c53f bpo-34596: Fallback to a default reason when @unittest.skip is uncalled (#9082)
* bpo-34596: Fallback to a default reason when @unittest.skip is uncalled

* Change default reason to empty string

* Fix rst formatting of NEWS entry
2019-09-09 16:06:48 +02:00
Vinay Sajip 264e034f99
bpo-37662: Documented venv.EnvBuilder.upgrade_dependencies(). (GH-15768) 2019-09-09 14:50:38 +01:00
animalize 77643c486f bpo-38037: Fix reference counters in signal module (GH-15753) 2019-09-09 15:46:26 +02:00
Steve Dower ef66f31ce2 bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766) 2019-09-09 14:24:15 +01:00
Mickaël Schoentgen 992347d737 bpo-26185: Fix repr() on empty ZipInfo object (#13441)
* bpo-26185: Fix repr() on empty ZipInfo object

It was failing on AttributeError due to inexistant
but required attributes file_size and compress_size.
They are now initialized to 0 in ZipInfo.__init__().

* Remove useless hasattr() in ZipInfo._open_to_write()

* Completely remove file_size setting in _open_to_write().
2019-09-09 06:08:54 -07:00
Ashwin Vishnu 1a8de82d3a Fix typo in math.prod example (GH-15614) 2019-09-09 13:42:27 +01:00
neonene ed70129e15 bpo-37702: Fix SSL's certificate-store leak on Windows (GH-15632)
ssl_collect_certificates function in _ssl.c has a memory leak.
Calling CertOpenStore() and CertAddStoreToCollection(), a store's refcnt gets incremented by 2.
But CertCloseStore() is called only once and the refcnt leaves 1.
2019-09-09 05:33:43 -07:00
T. Wouters b4612f5d54
bpo-37589: Add a few missing dependencies on .h files in the Makefile. (GH-15757)
The missing dependencies prevented incremental builds from working when you touched any
of these files. Based on GH-14758 by @vemakereporter.
2019-09-09 05:17:18 -07:00
Steve Dower 3a0ddbcdfc
bpo-37283: Ensure command-line and unattend.xml setting override previously detected states in Windows installer (GH-15759) 2019-09-09 05:15:07 -07:00
Benjamin Peterson bed04b6647
bpo-34652 again: Remove lchmod from the default AC_CHECK_FUNCS list. (GH-15758) 2019-09-09 05:13:00 -07:00
David Röthlisberger 4f0f9f066e logging.Formatter docs: Add missing `validate` parameter, clarify `style` parameter (GH-15222) 2019-09-09 12:29:54 +01:00
Xtreak 9d607061c9 bpo-37212: Preserve keyword argument order in unittest.mock.call and error messages (GH-14310) 2019-09-09 05:55:22 -05:00
Julien Palard 63c98ed2d2
Doc: Fix PDF build (NoUri). (GH-15739) 2019-09-09 12:54:56 +02:00
Anthony Sottile bba9207248 Future-proof .travis.yml for Python 3.10 (GH-14831) 2019-09-09 05:49:33 -05:00
Daniel Hahler 8d64bfafdf bpo-36250: ignore ValueError from signal in non-main thread (GH-12251)
Authored-By: blueyed <github@thequod.de>
2019-09-09 05:45:58 -05:00
Zackery Spytz 19052a1131 bpo-37705: Improve the implementation of winerror_to_errno() (GH-15623)
winerror_to_errno() is no longer automatically generated.
Do not rely on the old _dosmapperr() function.
Add ERROR_NO_UNICODE_TRANSLATION (1113) -> EILSEQ.
2019-09-09 02:35:08 -07:00
Greg Price 5e5e951502 bpo-37936: Avoid ignoring files that we actually do track. (GH-15451)
There were about 14 files that are actually in the repo but that are
covered by the rules in .gitignore.

Git itself takes no notice of what .gitignore says about files that
it's already tracking... but the discrepancy can be confusing to a
human that adds a new file unexpectedly covered by these rules, as
well as to non-Git software that looks at .gitignore but doesn't
implement this wrinkle in its semantics.  (E.g., `rg`.)

Several of these are from rules that apply more broadly than
intended: for example, `Makefile` applies to `Doc/Makefile` and
`Tools/freeze/test/Makefile`, whereas `/Makefile` means only the
`Makefile` at the repo's root.

And the `Modules/Setup` rule simply wasn't updated after 961d54c5c.


https://bugs.python.org/issue37936
2019-09-09 02:34:50 -07:00
Zackery Spytz e223ba13d8 bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (#13239)
* bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations

* Address review comments.
2019-09-09 02:26:15 -07:00
Zackery Spytz a6563650c8 bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls (GH-14462)
If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition.
2019-09-09 02:20:38 -07:00
Greg Price 7669cb8b21 bpo-38043: Use `bool` for boolean flags on is_normalized_quickcheck. (GH-15711) 2019-09-09 02:16:31 -07:00
Ngalim Siregar 71ea688d66 bpo-11953: Extend table of Windows WSA* error codes (GH-15004) 2019-09-09 02:15:14 -07:00
Florian Bruhin 1f86fdcfc5 bpo-15817: gdbinit: Document commands after defining them (GH-15021)
The gdb manual[1] says the following for "document":

  The command commandname must already be defined.

[1] https://sourceware.org/gdb/current/onlinedocs/gdb/Define.html

And indeed when trying to use the gdbinit file with gdb 8.3, I get:

  .../cpython/Misc/gdbinit:17: Error in sourced command file:
  Undefined command: "pyo".  Try "help".

Fix this by moving all documentation blocks after the define blocks.

This was introduced in GH-6384.
2019-09-09 04:06:37 -05:00
Xtreak aa51508274 Fix assertions regarding magic methods function body that was not executed (GH-14154) 2019-09-09 10:04:57 +01:00
Serhiy Storchaka 526a01467b
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
2019-09-09 11:47:14 +03:00
Serhiy Storchaka 918b468b7d
Revert "Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)" (GH-15736)
This reverts commit fa220ec763.
2019-09-09 11:18:16 +03:00