Commit Graph

44895 Commits

Author SHA1 Message Date
Daniel Andrade 4a12a178f4 bpo-34331: Fix incorrectly pluralized abstract class error message. (GH-8670) 2019-09-11 17:29:44 +02:00
Daniel Abrahamsson 5209e586b7 bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15330)
Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning:

``` 
$ python3 -m venv test
$ source test/bin/activate
(test) $ deactivate
-bash: $1: unbound variable
```
2019-09-11 07:58:56 -07:00
Steve Dower 574b324bdc bpo-36634: Fixes activate.bat when existing values contain double quotes (GH-15924) 2019-09-11 15:41:21 +01:00
blhsing 72c359912d bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable (GH-15565)
* bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable

* 📜🤖 Added by blurb_it.

* Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst

added name of the contributor

* bpo-37972: made all dunder methods chainable for _Call

* bpo-37972: delegate only attributes of tuple instead to __getattr__
2019-09-11 16:28:06 +02:00
Pavel Koneski b6643dcfc2 bpo-36919: make test_source_encoding.test_issue2301 implementation-independent (#13639)
* bpo-36919: make test_issue2301 implementation-independent
2019-09-11 14:57:32 +01:00
Jakub Kulík 95da826db9 closes bpo-37252: Fix devpoll tests. (GH-14017) 2019-09-11 14:42:04 +01:00
Filip Š 4b41745b3c bpo-37305: add MIME type for Web App Manifest (#14199)
* bpo-37305: add MIME type for Web App Manifest

* bpo-37305: add news entry

* Restore indentation and sort by value
2019-09-11 14:32:04 +01:00
hui shang 088a09af4b bpo-31163: Added return values to pathlib.Path instance's rename and replace methods. (GH-13582)
* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
2019-09-11 14:26:49 +01:00
Michael Osipov a828514cc3 bpo-34519: Add additional aliases for HP Roman 8 (GH-8956)
* bpo-34519: Add additional aliases for HP Roman 8

HP Roman 8 is known under mode aliases than listed in aliases.py.

Patch by Michael Osipov.
2019-09-11 14:08:41 +01:00
Andrew Svetlov 9aee90018a
bpo-38107: Replace direct future and task contructor calls with factories in asyncio tests (GH-15928) 2019-09-11 16:07:37 +03:00
Géry Ogam 781266ebb6 bpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler (GH-11398) 2019-09-11 14:03:46 +01:00
Pierre Quentel 2d7cacacc3 bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… (#10638)
* bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has no content-length header

* Add Misc/NEWS.d/next file.

* Add rst formatting for NEWS.d/next file

* Reaplce assert by self.assertEqual
2019-09-11 12:05:53 +01:00
Alex 972cf5c06a bpo-35168: Make shlex.punctuation_chars read-only (#11631)
* bpo-35168: Documentation about shlex.punctuation_chars now states that it should be set in __init__.py

* bpo-35168: Convert shlex.punctuation_chars to read-only property

* Add NEWS.d entry
2019-09-11 12:04:04 +01:00
Benjamin Peterson f2173ae38f
bpo-35066: Make trailing percent test more portable. (GH-15907)
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
2019-09-11 11:50:38 +01:00
Ben Lewis 92420b3e67 bpo-37409: fix relative import with no parent (#14956)
Relative imports use resolve_name to get the absolute target name,
which first seeks the current module's absolute package name from the globals:
If __package__ (and __spec__.parent) are missing then
import uses __name__, truncating the last segment if
the module is a submodule rather than a package __init__.py
(which it guesses from whether __path__ is defined).

The __name__ attempt should fail if there is no parent package (top level modules),
if __name__ is '__main__' (-m entry points), or both (scripts).
That is, if both __name__ has no subcomponents and the module does not seem
to be a package __init__ module then import should fail.
2019-09-11 11:09:47 +01:00
Steve Dower 92521fea5d bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899) 2019-09-11 10:48:36 +01:00
Greg Price 455122a009 bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823)
A root cause of bpo-37936 is that it's easy to write a .gitignore
rule that's intended to apply to a specific file (e.g., the
`pyconfig.h` generated by `./configure`) but actually applies to all
similarly-named files in the tree (e.g., `PC/pyconfig.h`.)

Specifically, any rule with no non-trailing slashes is applied in an
"unrooted" way, to files anywhere in the tree.  This means that if we
write the rules in the most obvious-looking way, then

 * for specific files we want to ignore that happen to be in
   subdirectories (like `Modules/config.c`), the rule will work
   as intended, staying "rooted" to the top of the tree; but

 * when a specific file we want to ignore happens to be at the root of
   the repo (like `platform`), then the obvious rule (`platform`) will
   apply much more broadly than intended: if someone tries to add a
   file or directory named `platform` somewhere else in the tree, it
   will unexpectedly get ignored.

That's surprising behavior that can make the .gitignore file's
behavior feel finicky and unpredictable.

To avoid it, we can simply always give a rule "rooted" behavior when
that's what's intended, by systematically using leading slashes.

Further, to help make the pattern obvious when looking at the file and
minimize any need for thinking about the syntax when adding new rules:
separate the rules into one group for each type, with brief comments
identifying them.

For most of these rules it's clear whether they're meant to be rooted
or unrooted, but in a handful of cases I've only guessed.  In that
case the safer default (the choice that won't hide information) is the
narrower, rooted meaning, with a leading slash.  If for some of these
the unrooted meaning is desired after all, it'll be easy to move them
to the unrooted section at the top.
2019-09-11 10:25:26 +01:00
Gregory P. Smith 580d2782f7 bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)
Fixes a possible hang when using a timeout on subprocess.run() while
capturing output. If the child process spawned its own children or otherwise
connected its stdout or stderr handles with another process, we could hang
after the timeout was reached and our child was killed when attempting to read
final output from the pipes.
2019-09-11 02:23:05 -07:00
Eddie Elizondo ff023ed36e bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)
The instance destructor for a type is responsible for preparing
an instance for deallocation by decrementing the reference counts
of its referents.

If an instance belongs to a heap type, the type object of an instance
has its reference count decremented while for static types, which
are permanently allocated, the type object is unaffected by the
instance destructor.

Previously, the default instance destructor searched the class
hierarchy for an inherited instance destructor and, if present,
would invoke it.

Then, if the instance type is a heap type, it would decrement the
reference count of that heap type.  However, this could result in the
premature destruction of a type because the inherited instance
destructor should have already decremented the reference count
of the type object.

This change avoids the premature destruction of the type object
by suppressing the decrement of its reference count when an
inherited, non-default instance destructor has been invoked.

Finally, an assertion on the Py_SIZE of a type was deleted.  Heap
types have a non zero size, making this into an incorrect assertion.

https://github.com/python/cpython/pull/15323
2019-09-11 10:17:13 +01:00
Andrew Svetlov 7264e92b71 bpo-36373: Fix deprecation warnings (GH-15889)
https://bugs.python.org/issue36373
2019-09-11 01:20:24 -07:00
Gregory P. Smith 3f4db4a0ba bpo-28494: Test existing zipfile working behavior. (GH-15853)
Add unittests for executables with a zipfile appended to test_zipfile, as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.
2019-09-10 09:14:11 -07:00
Gordon P. Hemsley 7d952ded68 bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy() (GH-12995) 2019-09-10 16:22:01 +01:00
Ben Harper a9b6033179 bpo-36253: Remove use after free reference in ctypes test suite (GH-12257) 2019-09-10 08:20:15 -07:00
Jason R. Coombs 17499d8270 bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)
https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21
2019-09-10 14:53:31 +01:00
Steve Dower 97d7906e30 bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850) 2019-09-10 14:52:48 +01:00
Steve Dower cd8221152d bpo-38088: Fixes distutils not finding vcruntime140.dll with only v142 toolset installed (GH-15849) 2019-09-10 14:52:23 +01:00
Matthias 182e1d1f84 Fix subprocess docstring typo (GH-15812) 2019-09-10 14:51:09 +01:00
Serhiy Storchaka 88bdb9280b bpo-36781: Optimize sum() for bools. (#13074)
* Optimize sum() for bools.

* Fix sum([], False).

* Add a NEWS entry.
2019-09-10 14:31:01 +01:00
Andrew Svetlov 12c122ae95 bpo-38066: Hide internal Stream methods (GH-15762)
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now.


https://bugs.python.org/issue38066
2019-09-10 05:56:14 -07:00
Bernt Røskar Brenna 734f1202a5 closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836) 2019-09-10 13:43:58 +01:00
Emmanuel Arias 9008be303a bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

fourth step: queue.py





https://bugs.python.org/issue36373
2019-09-10 04:46:12 -07:00
Jeroen Demeyer 57ea335606 bpo-37619: update_one_slot() should not ignore wrapper descriptors for wrong type (GH-14836) 2019-09-10 04:21:57 -07:00
Petr Viktorin f958377b67 bpo-37499: Test various C calling conventions (GH-15776)
Add functions with various calling conventions to `_testcapi`, expose them as module-level functions, bound methods, class methods, and static methods, and test calling them and introspecting them through GDB.


https://bugs.python.org/issue37499


Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
Automerge-Triggered-By: @pganssle
2019-09-10 04:21:09 -07:00
Lisa Roach f1a297acb6
bpo-37251: Removes __code__ check from _is_async_obj. (GH-15830) 2019-09-10 12:18:40 +01:00
Emmanuel Arias 537877d85d bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [locks] (GH-13920)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

Third step: locks.py





https://bugs.python.org/issue36373
2019-09-10 03:55:07 -07:00
hliu0 8e7ff6aba3 Skip zoneinfo tests on VxWorks (#13535) 2019-09-10 11:28:11 +01:00
Dino Viehland 4f384af067 bpo-38076: Make struct module PEP-384 compatible (#15805)
* PEP-384 _struct

* More PEP-384 fixes for _struct

Summary: Add a couple of more fixes for `_struct` that were previously missed such as removing `tp_*` accessors and using `PyBytesWriter` instead of calling `PyBytes_FromStringAndSize` with `NULL`. Also added a test to confirm that `iter_unpack` type is still uninstantiable.

* 📜🤖 Added by blurb_it.
2019-09-10 03:18:37 -07:00
Greg Price 1ad0c776cb bpo-38043: Move unicodedata.normalize tests into test_unicodedata. (GH-15712)
Having these in a separate file from the one that's named after the
module in the usual way makes it very easy to miss them when looking
for tests for these two functions.

(In fact when working recently on is_normalized, I'd been surprised to
see no tests for it here and concluded the function had evaded being
tested at all.  I'd gone as far as to write up some tests myself
before I spotted this other file.)

Mostly this just means moving all the one file's code into the other,
and moving code from the module toplevel to inside the test class to
keep it tidily separate from the rest of the file's code.

There's one substantive change, which reduces by a bit the amount of
code to be moved: we drop the `x > sys.maxunicode` conditional and all
the `RangeError` logic behind it.  Now if that condition ever occurs
it will cause an error at `chr(x)`, and a test failure.  That's the
right result because, since PEP 393 in Python 3.3, there is no longer
such a thing as an "unsupported character".
2019-09-10 10:29:26 +01:00
Vinay Sharma 2fc1160a80 bpo-38018: Fix test for multiprocessing.shared_memory in BSD systems (GH-15821) 2019-09-10 07:48:24 +01:00
Terry Jan Reedy c59295a1ca
bpo-38077: IDLE no longer adds 'argv' to the user namespace (GH-15818)
This only happened when initializing the subprocess to run a module.
This recent bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
2019-09-09 23:10:44 -04:00
Serhiy Storchaka 832e864008
bpo-38049: Add command-line interface for the ast module. (GH-15724) 2019-09-09 23:36:13 +03:00
Vinay Sharma d14e39c8d9 bpo-38018: Increase code coverage for multiprocessing.shared_memory (GH-15662) 2019-09-09 11:48:55 -05: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
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
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
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