]> granicus.if.org Git - python/log
python
5 years agobpo-36853: Fix suspicious.py to actually print the unused rules (#13579)
Anthony Sottile [Mon, 2 Sep 2019 16:01:23 +0000 (09:01 -0700)]
bpo-36853: Fix suspicious.py to actually print the unused rules (#13579)

* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls

5 years agobpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646)
Jason R. Coombs [Mon, 2 Sep 2019 15:08:03 +0000 (11:08 -0400)]
bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646)

Sync importlib.metadata with importlib_metadata 0.20.

5 years agobpo-15999: Clean up of handling boolean arguments. (GH-15610)
Serhiy Storchaka [Sun, 1 Sep 2019 09:16:51 +0000 (12:16 +0300)]
bpo-15999: Clean up of handling boolean arguments. (GH-15610)

* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.

5 years agobpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621)
Serhiy Storchaka [Sun, 1 Sep 2019 09:12:52 +0000 (12:12 +0300)]
bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621)

5 years agobpo-15999: Always pass bool instead of int to the expat parser. (GH-15622)
Serhiy Storchaka [Sun, 1 Sep 2019 09:11:43 +0000 (12:11 +0300)]
bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622)

5 years agobpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)
Serhiy Storchaka [Sun, 1 Sep 2019 09:03:39 +0000 (12:03 +0300)]
bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)

Only AttributeError should be silenced.

5 years agobpo-36543: Remove old-deprecated ElementTree features. (GH-12707)
Serhiy Storchaka [Sun, 1 Sep 2019 08:18:35 +0000 (11:18 +0300)]
bpo-36543: Remove old-deprecated ElementTree features. (GH-12707)

Remove methods Element.getchildren(), Element.getiterator() and
ElementTree.getiterator() and the xml.etree.cElementTree module.

5 years agobpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239)
Ashwin Ramaswami [Sat, 31 Aug 2019 15:25:35 +0000 (10:25 -0500)]
bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239)

Fixes a case in which email._header_value_parser.get_unstructured hangs the system for some invalid headers. This covers the cases in which the header contains either:
- a case without trailing whitespace
- an invalid encoded word

https://bugs.python.org/issue37764

This fix should also be backported to 3.7 and 3.8

https://bugs.python.org/issue37764

5 years agobpo-37977: Warn more strongly and clearly about pickle security (GH-15595)
Daniel Pope [Sat, 31 Aug 2019 05:51:33 +0000 (06:51 +0100)]
bpo-37977: Warn more strongly and clearly about pickle security (GH-15595)

5 years agobpo-37990: fix gc stats (GH-15626)
Inada Naoki [Sat, 31 Aug 2019 00:13:42 +0000 (09:13 +0900)]
bpo-37990: fix gc stats (GH-15626)

5 years agobpo-37781: use "z" for PY_FORMAT_SIZE_T (GH-15156)
Inada Naoki [Fri, 30 Aug 2019 23:48:12 +0000 (08:48 +0900)]
bpo-37781: use "z" for PY_FORMAT_SIZE_T (GH-15156)

MSVC 2015 supports %zd / %zu.  "z" is portable enough nowadays.

5 years agoFix typos mostly in comments, docs and test names (GH-15209)
Min ho Kim [Fri, 30 Aug 2019 20:21:19 +0000 (06:21 +1000)]
Fix typos mostly in comments, docs and test names (GH-15209)

5 years agoIDLE: Fix 2 typos found by Min ho Kim. (GH-15617)
Terry Jan Reedy [Fri, 30 Aug 2019 20:16:37 +0000 (16:16 -0400)]
IDLE: Fix 2 typos found by Min ho Kim. (GH-15617)

5 years agobpo-37140: Fix StructUnionType_paramfunc() (GH-15612)
Victor Stinner [Fri, 30 Aug 2019 12:30:33 +0000 (14:30 +0200)]
bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)

Fix a ctypes regression of Python 3.8. When a ctypes.Structure is
passed by copy to a function, ctypes internals created a temporary
object which had the side effect of calling the structure finalizer
(__del__) twice. The Python semantics requires a finalizer to be
called exactly once. Fix ctypes internals to no longer call the
finalizer twice.

Create a new internal StructParam_Type which is only used by
_ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument).
StructUnionType_paramfunc() creates such object.

5 years agobpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)
Sergey Fedoseev [Fri, 30 Aug 2019 04:25:48 +0000 (09:25 +0500)]
bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)

5 years agoSteven Bethard designated a new maintainer for argparse (GH-15605)
Raymond Hettinger [Fri, 30 Aug 2019 04:04:37 +0000 (21:04 -0700)]
Steven Bethard designated a new maintainer for argparse (GH-15605)

5 years agobpo-37834: Prevent shutil.rmtree exception (GH-15602)
Ned Deily [Thu, 29 Aug 2019 21:20:03 +0000 (17:20 -0400)]
bpo-37834: Prevent shutil.rmtree exception (GH-15602)

when built on non-Windows system without fd system call support,
like older versions of macOS.

5 years agobpo-37933: Fix faulthandler.cancel_dump_traceback_later() (GH-15440)
Thomas A Caswell [Thu, 29 Aug 2019 16:30:04 +0000 (12:30 -0400)]
bpo-37933: Fix faulthandler.cancel_dump_traceback_later() (GH-15440)

Fix faulthandler.cancel_dump_traceback_later() call
if cancel_dump_traceback_later() was not called previously.

5 years agobpo-8425: Fast path for set inplace difference when the second set is large (GH-15590)
Raymond Hettinger [Thu, 29 Aug 2019 16:02:58 +0000 (09:02 -0700)]
bpo-8425: Fast path for set inplace difference when the second set is large (GH-15590)

5 years agobpo-37034: Display argument name on errors with keyword arguments with Argument Clini...
Rémi Lapeyre [Thu, 29 Aug 2019 14:49:08 +0000 (16:49 +0200)]
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)

5 years agobpo-37979: Add alternative to fromisoformat in documentation (GH-15596)
Paul Ganssle [Thu, 29 Aug 2019 14:47:48 +0000 (10:47 -0400)]
bpo-37979: Add alternative to fromisoformat in documentation (GH-15596)

Adds a link to `dateutil.parser.isoparse` in the documentation.

It would be nice to set up intersphinx for things like this, but I think we can leave that for a separate PR.

CC: @pitrou
[bpo-37979](https://bugs.python.org/issue37979)

https://bugs.python.org/issue37979

Automerge-Triggered-By: @pitrou
5 years agobpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)
Nick Coghlan [Thu, 29 Aug 2019 13:26:53 +0000 (23:26 +1000)]
bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)

With `symtable_visit_expr` now correctly adjusting the recursion depth for named
expressions, `symtable_handle_namedexpr` should be leaving it alone.

Also adds a new check to `PySymtable_BuildObject` that raises `SystemError`
if a successful first symbol analysis pass fails to keep the stack depth
accounting clean.

5 years agobpo-36833: Add tests for Datetime C API Macros (GH-14842)
Joannah Nanjekye [Thu, 29 Aug 2019 12:54:46 +0000 (09:54 -0300)]
bpo-36833: Add tests for Datetime C API Macros (GH-14842)

Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of
the datetime module.

5 years agobpo-10978: Semaphores can release multiple threads at a time (GH-15588)
Raymond Hettinger [Thu, 29 Aug 2019 08:45:19 +0000 (01:45 -0700)]
bpo-10978: Semaphores can release multiple threads at a time (GH-15588)

5 years agobpo-36743: __get__ is sometimes called without the owner argument (#12992)
Raymond Hettinger [Thu, 29 Aug 2019 08:27:42 +0000 (01:27 -0700)]
bpo-36743: __get__ is sometimes called without the owner argument (#12992)

5 years agobpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566)
Raymond Hettinger [Thu, 29 Aug 2019 07:58:08 +0000 (00:58 -0700)]
bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566)

5 years agobpo-23674: Clarify ambiguities in super() docs (#15564)
Raymond Hettinger [Thu, 29 Aug 2019 07:44:02 +0000 (00:44 -0700)]
bpo-23674:  Clarify ambiguities in super() docs (#15564)

5 years agobpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds...
Justin Blanchard [Thu, 29 Aug 2019 07:36:15 +0000 (03:36 -0400)]
bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307)

5 years agobpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH-15510)
Serhiy Storchaka [Thu, 29 Aug 2019 06:30:23 +0000 (09:30 +0300)]
bpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH-15510)

5 years agobpo-37960: Silence only necessary errors in repr() of buffered and text streams....
Serhiy Storchaka [Thu, 29 Aug 2019 06:25:22 +0000 (09:25 +0300)]
bpo-37960: Silence only necessary errors in repr() of buffered and text streams. (GH-15543)

5 years agobpo-35946: Improve assert_called_with documentation (GH-11796)
Rémi Lapeyre [Thu, 29 Aug 2019 06:15:53 +0000 (08:15 +0200)]
bpo-35946: Improve assert_called_with documentation (GH-11796)

5 years agobpo-36871: Ensure method signature is used when asserting mock calls to a method...
Xtreak [Thu, 29 Aug 2019 06:09:01 +0000 (11:39 +0530)]
bpo-36871: Ensure method signature is used when asserting mock calls to a method (GH13261)

* Fix call_matcher for mock when using methods

* Add NEWS entry

* Use None check and convert doctest to unittest

* Use better name for mock in tests. Handle _SpecState when the attribute was not accessed and add tests.

* Use reset_mock instead of reinitialization. Change inner class constructor signature for check

* Reword comment regarding call object lookup logic

5 years agobpo-25777: Wording describes a lookup, not a call (GH-15573)
Raymond Hettinger [Thu, 29 Aug 2019 05:59:43 +0000 (22:59 -0700)]
bpo-25777: Wording describes a lookup, not a call (GH-15573)

5 years agobpo-36167: fix an incorrect capitalization (GH-14482)
avinassh [Thu, 29 Aug 2019 05:40:50 +0000 (11:10 +0530)]
bpo-36167: fix an incorrect capitalization (GH-14482)

5 years agobpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568)
Benjamin Peterson [Thu, 29 Aug 2019 05:06:49 +0000 (22:06 -0700)]
bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568)

5 years agobpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736)
Ronald Oussoren [Thu, 29 Aug 2019 04:33:52 +0000 (06:33 +0200)]
bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736)

5 years agoRaise a RuntimeError when tee iterator is consumed from different threads (GH-15567)
HongWeipeng [Thu, 29 Aug 2019 03:39:25 +0000 (11:39 +0800)]
Raise a RuntimeError when tee iterator is consumed from different threads (GH-15567)

5 years agocloses bpo-37964: add F_GETPATH command to fcntl (GH-15550)
Vinay Sharma [Thu, 29 Aug 2019 01:56:17 +0000 (07:26 +0530)]
closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)

https://bugs.python.org/issue37964

Automerge-Triggered-By: @benjaminp
5 years agobpo-23878: Remove an unneeded fseek() call in _Py_FindEnvConfigValue() (GH-15424)
Zackery Spytz [Wed, 28 Aug 2019 21:54:02 +0000 (15:54 -0600)]
bpo-23878: Remove an unneeded fseek() call in _Py_FindEnvConfigValue() (GH-15424)

5 years agocloses bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH...
Anonymous Maarten [Wed, 28 Aug 2019 17:11:03 +0000 (19:11 +0200)]
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15560)

https://bugs.python.org/issue37965

https://bugs.python.org/issue37965

Automerge-Triggered-By: @benjaminp
5 years agobpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138)
Daniel Fortunov [Wed, 28 Aug 2019 04:38:09 +0000 (06:38 +0200)]
bpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138)

5 years agobpo-37951: Lift subprocess's fork() restriction (GH-15544)
Christian Heimes [Tue, 27 Aug 2019 21:36:56 +0000 (23:36 +0200)]
bpo-37951: Lift subprocess's fork() restriction (GH-15544)

5 years agoAdd Florian Ernst to ACKS (GH-15524)
Ethan Furman [Tue, 27 Aug 2019 21:18:05 +0000 (14:18 -0700)]
Add Florian Ernst to ACKS (GH-15524)

5 years agobpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)
Greg Price [Tue, 27 Aug 2019 18:16:31 +0000 (11:16 -0700)]
bpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)

These appeared in commit c5ae169e1.  The comment on them, as well as
the presence among them of a rule for the .gitignore file itself,
indicate that the author intended these lines to remain only in their
own local working tree -- not to get committed even to their own repo,
let alone merged upstream.

They did nevertheless get committed, because it turns out that Git
takes no notice of what .gitignore says about files that it's already
tracking... for example, this .gitignore file itself.

Give effect to these lines' original intention, by deleting them. :-)

Git tip, for reference: the `.git/info/exclude` file is a handy way
to do exactly what these lines were originally intended to do.  A
related handy file is `~/.config/git/ignore`.  See gitignore(5),
aka `git help ignore`, for details.

https://bugs.python.org/issue37936

Automerge-Triggered-By: @zware
5 years agoFix unused variable and signed/unsigned warnings (GH-15537)
Raymond Hettinger [Tue, 27 Aug 2019 16:55:13 +0000 (09:55 -0700)]
Fix unused variable and signed/unsigned warnings (GH-15537)

5 years agobpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
vrajivk [Tue, 27 Aug 2019 04:13:12 +0000 (21:13 -0700)]
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)

5 years agobpo-37328: remove deprecated HTMLParser.unescape (GH-14186)
Inada Naoki [Tue, 27 Aug 2019 02:48:06 +0000 (11:48 +0900)]
bpo-37328: remove deprecated HTMLParser.unescape (GH-14186)

It is deprecated since Python 3.4.

5 years agobpo-36763: Make Py_BytesMain() public (GH-15532)
Victor Stinner [Mon, 26 Aug 2019 22:45:45 +0000 (00:45 +0200)]
bpo-36763: Make Py_BytesMain() public (GH-15532)

Declare Py_BytesMain() in Include/pylifecycle.h, rather in
Include/internal/pycore_pylifecycle.h.

5 years agoFix an invalid assertEqual() call in test_descr.py (GH-15318)
Zackery Spytz [Mon, 26 Aug 2019 22:41:11 +0000 (16:41 -0600)]
Fix an invalid assertEqual() call in test_descr.py (GH-15318)

5 years agoMake PyXXX_Fini() functions private (GH-15531)
Victor Stinner [Mon, 26 Aug 2019 22:12:32 +0000 (00:12 +0200)]
Make PyXXX_Fini() functions private (GH-15531)

For example, rename PyTuple_Fini() to _PyTuple_Fini().

These functions are only declared in the internal C API.

5 years agobpo-37925: Mention --embed in python-config usage (GH-15458)
Batuhan Taşkaya [Mon, 26 Aug 2019 21:45:37 +0000 (00:45 +0300)]
bpo-37925: Mention --embed in python-config usage (GH-15458)

5 years agobpo-37798: Minor code formatting and comment clean-ups. (GH-15526)
Raymond Hettinger [Mon, 26 Aug 2019 18:25:58 +0000 (11:25 -0700)]
bpo-37798: Minor code formatting and comment clean-ups. (GH-15526)

5 years agobpo-37664: Update ensurepip bundled wheels, again (GH-15483)
Pradyun Gedam [Mon, 26 Aug 2019 18:19:30 +0000 (23:49 +0530)]
bpo-37664: Update ensurepip bundled wheels, again (GH-15483)

/cc @ambv since this needs to be included in 3.8 -- see https://github.com/pypa/pip/issues/6885.

Sorry about the last minute PR!

https://bugs.python.org/issue37664

Automerge-Triggered-By: @zooba
5 years agobpo-37055: fix warnings in _blake2 module (GH-14646)
Inada Naoki [Mon, 26 Aug 2019 17:52:36 +0000 (02:52 +0900)]
bpo-37055: fix warnings in _blake2 module (GH-14646)

https://bugs.python.org/issue37055

Automerge-Triggered-By: @tiran
5 years agocorrect roman numeral VII description (GH-15523)
Ethan Furman [Mon, 26 Aug 2019 16:12:50 +0000 (09:12 -0700)]
correct roman numeral VII description (GH-15523)

5 years agoFix typo: Pyssize_t => Py_ssize_t (GH-15411)
Sergey Fedoseev [Mon, 26 Aug 2019 15:20:42 +0000 (20:20 +0500)]
Fix typo: Pyssize_t => Py_ssize_t (GH-15411)

5 years agobpo-37954: Fix reference leak in the symtable (GH-15514)
Pablo Galindo [Mon, 26 Aug 2019 15:14:07 +0000 (16:14 +0100)]
bpo-37954: Fix reference leak in the symtable (GH-15514)

5 years agoRemove leftovers from the times when long long wasn't required (GH-15501)
Sergey Fedoseev [Mon, 26 Aug 2019 15:12:47 +0000 (20:12 +0500)]
Remove leftovers from the times when long long wasn't required (GH-15501)

In a38e9d139929a227e3899fbb638bc46c6cc6d8ba pyconfig.h.in was
manually edited and that edit was overwritten when running autoreconf.

5 years agobpo-37947: Adjust correctly the recursion level in symtable for named expressions...
Pablo Galindo [Mon, 26 Aug 2019 14:52:25 +0000 (15:52 +0100)]
bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499)

5 years agobpo-34679: Restore instantiation Windows IOCP event loop from non-main thread (#15492)
Andrew Svetlov [Mon, 26 Aug 2019 09:51:08 +0000 (12:51 +0300)]
bpo-34679: Restore instantiation Windows IOCP event loop from non-main thread (#15492)

* Restore running proactor event loop from non-main thread

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
5 years agobpo-27575: port set intersection logic into dictview intersection (GH-7696)
Forest Gregg [Mon, 26 Aug 2019 07:17:43 +0000 (02:17 -0500)]
bpo-27575: port set intersection logic into dictview intersection (GH-7696)

5 years agobpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). (GH-15490)
Serhiy Storchaka [Mon, 26 Aug 2019 07:13:19 +0000 (10:13 +0300)]
bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). (GH-15490)

It emits a deprecation warning and calls corresponding method
visit_Num(), visit_Str(), etc.

5 years agobpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)
Dong-hee Na [Mon, 26 Aug 2019 07:04:35 +0000 (16:04 +0900)]
bpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)

https://bugs.python.org/issue37805

Automerge-Triggered-By: @methane
5 years agobpo-15542: Documentation incorrectly suggests __init__ called after direct __new__...
Joannah Nanjekye [Mon, 26 Aug 2019 06:53:11 +0000 (03:53 -0300)]
bpo-15542: Documentation incorrectly suggests __init__ called after direct  __new__ call (GH-15478)

5 years agobpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)
Terry Jan Reedy [Mon, 26 Aug 2019 06:27:56 +0000 (02:27 -0400)]
bpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)

Cease turning SyntaxWarnings into SyntaxErrors.

5 years agoDoc: Keep the venv/* exclude pattern. (GH-15229)
Julien Palard [Mon, 26 Aug 2019 06:11:43 +0000 (08:11 +0200)]
Doc: Keep the venv/* exclude pattern. (GH-15229)

In case it has been previously created.

5 years agobpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups (GH-14976)
Flavian Hautbois [Sun, 25 Aug 2019 19:06:45 +0000 (21:06 +0200)]
bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups (GH-14976)

Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
5 years agobpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)
Nick Coghlan [Sun, 25 Aug 2019 13:45:40 +0000 (23:45 +1000)]
bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)

- drop TargetScopeError in favour of raising SyntaxError directly
  as per the updated PEP 572
- comprehension iteration variables are explicitly local, but
  named expression targets in comprehensions are nonlocal or
  global. Raise SyntaxError as specified in PEP 572
- named expression targets in the outermost iterable of a
  comprehension have an ambiguous target scope. Avoid resolving
  that question now by raising SyntaxError. PEP 572
  originally required this only for cases where the bound name
  conflicts with the iteration variable in the comprehension,
  but CPython can't easily restrict the exception to that case
  (as it doesn't know the target variable names when visiting
  the outermost iterator expression)

5 years agobpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)
Zackery Spytz [Sun, 25 Aug 2019 09:44:09 +0000 (03:44 -0600)]
bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)

Fix assert statement misbehavior if AssertionError is shadowed.

5 years agobpo-37905: Improve docs for NormalDist (GH-15486)
Raymond Hettinger [Sun, 25 Aug 2019 07:57:26 +0000 (00:57 -0700)]
bpo-37905: Improve docs for NormalDist (GH-15486)

5 years agobpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
Tal Einat [Sun, 25 Aug 2019 05:52:58 +0000 (08:52 +0300)]
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)

These were caused by keeping around a reference to the Squeezer
instance and calling it's load_font() upon config changes, which
sometimes happened even if the shell window no longer existed.

This change completely removes that mechanism, instead having the
editor window properly update its width attribute, which can then
be used by Squeezer.

5 years agobpo-37942: Improve argument clinic float converter (GH-15470)
Raymond Hettinger [Sun, 25 Aug 2019 02:10:39 +0000 (19:10 -0700)]
bpo-37942: Improve argument clinic float converter (GH-15470)

5 years agobpo-19072: Make @classmethod support chained decorators (GH-8405)
Berker Peksag [Sat, 24 Aug 2019 22:37:25 +0000 (01:37 +0300)]
bpo-19072: Make @classmethod support chained decorators (GH-8405)

5 years agoFix typo and rearrange words in IDLE news item (GH-15471)
Terry Jan Reedy [Sat, 24 Aug 2019 21:32:33 +0000 (17:32 -0400)]
Fix typo and rearrange words in IDLE news item (GH-15471)

Redo of #15402 by GeeTransit and Kyle Stanley.

5 years agoClarify argument types in datetime docs. (GH-15459)
Jürgen Gmach [Sat, 24 Aug 2019 19:48:55 +0000 (21:48 +0200)]
Clarify argument types in datetime docs. (GH-15459)

"Arguments may be integers... " could be misunderstand as they also
could be strings.

New wording makes it clear that arguments have to be integers.

modified:   Doc/library/datetime.rst

Automerge-Triggered-By: @pganssle
5 years agobpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465)
Raymond Hettinger [Sat, 24 Aug 2019 18:15:44 +0000 (11:15 -0700)]
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465)

5 years agoRevert "(TH-15402)" (#15468)
Terry Jan Reedy [Sat, 24 Aug 2019 18:10:04 +0000 (14:10 -0400)]
Revert "(TH-15402)" (#15468)

This reverts commit a50f0a4c2bd997e4534162ecc1853cb54c7ae902.

5 years agoFix typos in the documentation of Parser/pgen (GH-15416)
Shashi Ranjan [Sat, 24 Aug 2019 18:07:24 +0000 (23:37 +0530)]
Fix typos in the documentation of Parser/pgen (GH-15416)

Co-Authored-By: Antoine <43954001+awecx@users.noreply.github.com>
5 years agobpo-37798: Test both Python and C versions in test_statistics.py (GH-15453)
Dong-hee Na [Sat, 24 Aug 2019 17:51:20 +0000 (02:51 +0900)]
bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453)

5 years agobpo-32118: Simplify docs for sequence comparison (GH-15450)
Raymond Hettinger [Sat, 24 Aug 2019 17:43:55 +0000 (10:43 -0700)]
bpo-32118:  Simplify docs for sequence comparison (GH-15450)

5 years agobpo-37812: Convert CHECK_SMALL_INT macro to a function so the return is explicit...
Greg Price [Sat, 24 Aug 2019 17:19:37 +0000 (10:19 -0700)]
bpo-37812: Convert CHECK_SMALL_INT macro to a function so the return is explicit. (GH-15216)

5 years ago(TH-15402)
GeeTransit [Sat, 24 Aug 2019 17:01:36 +0000 (13:01 -0400)]
(TH-15402)

5 years agobpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170)
shireenrao [Sat, 24 Aug 2019 15:26:41 +0000 (11:26 -0400)]
bpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170)

* fix Path._add_implied_dirs to include all implied directories

* fix Path._add_implied_dirs to include all implied directories

* Optimize code by using sets instead of lists

* 📜🤖 Added by blurb_it.

* fix Path._add_implied_dirs to include all implied directories

* Optimize code by using sets instead of lists

* 📜🤖 Added by blurb_it.

* Add tests to zipfile.Path.iterdir() fix

* Update test for zipfile.Path.iterdir()

* remove whitespace from test file

* Rewrite NEWS blurb to describe the user-facing impact and avoid implementation details.

* remove redundant [] within set comprehension

* Update to use unique_everseen to maintain order and other suggestions in review

* remove whitespace and add back add_dirs in tests

* Add new standalone function parents using posixpath to get parents of a directory

* removing whitespace (sorry)

* Remove import pathlib from zipfile.py

* Rewrite _parents as a slice on a generator of the ancestry of a path.

* Remove check for '.' and '/', now that parents no longer returns those.

* Separate calculation of implied dirs from adding those

* Re-use _implied_dirs in tests for generating zipfile with dir entries.

* Replace three fixtures (abcde, abcdef, abde) with one representative example alpharep.

* Simplify implementation of _implied_dirs by collapsing the generation of parent directories for each name.

5 years agobpo-37830: Fix compilation of break and continue in finally. (GH-15320)
Serhiy Storchaka [Sat, 24 Aug 2019 10:11:52 +0000 (13:11 +0300)]
bpo-37830: Fix compilation of break and continue in finally. (GH-15320)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.

5 years agobpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269)
Serhiy Storchaka [Sat, 24 Aug 2019 09:49:27 +0000 (12:49 +0300)]
bpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269)

5 years agobpo-19119: Remove invalid test and rename a misnamed test (GH-15442)
Raymond Hettinger [Sat, 24 Aug 2019 05:31:22 +0000 (22:31 -0700)]
bpo-19119: Remove invalid test and rename a misnamed test (GH-15442)

5 years agoFix link to changelog in 3.9 What's New page (GH-15445)
Ned Deily [Sat, 24 Aug 2019 05:12:05 +0000 (01:12 -0400)]
Fix link to changelog in 3.9 What's New page (GH-15445)

5 years agoFix funny typo in Doc/bugs. (GH-15412)
Antoine [Sat, 24 Aug 2019 04:09:43 +0000 (06:09 +0200)]
Fix funny typo in  Doc/bugs. (GH-15412)

Fix typo in description of link to mozilla bug report writing guidelines.

Though the URL is misleading, we're indeed trying to write bug _reports_, not to add bugs.

Automerge-Triggered-By: @ned-deily
5 years agobpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266)
Dong-hee Na [Fri, 23 Aug 2019 22:20:30 +0000 (07:20 +0900)]
bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266)

5 years agobpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
Zackery Spytz [Fri, 23 Aug 2019 18:38:41 +0000 (12:38 -0600)]
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)

5 years agobpo-26589: Add http status code 451 (GH-15413)
Raymond Hettinger [Fri, 23 Aug 2019 17:19:15 +0000 (10:19 -0700)]
bpo-26589: Add http status code 451 (GH-15413)

5 years agobpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)
Victor Stinner [Fri, 23 Aug 2019 17:03:08 +0000 (18:03 +0100)]
bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)

PyConfig_Read() is now responsible to handle early calls to
PySys_AddXOption() and PySys_AddWarnOption().

Options added by PySys_AddXOption() are now handled the same way than
PyConfig.xoptions and command line -X options.

For example, PySys_AddXOption(L"faulthandler") enables faulthandler
as expected.

5 years agobpo-36763, doc: Add links in the new C API init doc (GH-15433)
Victor Stinner [Fri, 23 Aug 2019 16:59:12 +0000 (17:59 +0100)]
bpo-36763, doc: Add links in the new C API init doc (GH-15433)

5 years agobpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)
Victor Stinner [Fri, 23 Aug 2019 15:57:54 +0000 (16:57 +0100)]
bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)

5 years agoFix _PyTime_MIN/MAX values (GH-15384)
Sergey Fedoseev [Fri, 23 Aug 2019 15:39:09 +0000 (20:39 +0500)]
Fix _PyTime_MIN/MAX values (GH-15384)

_PyTime_t type is defined as int64_t, and so min/max are INT64_MIN/INT64_MAX,
not PY_LLONG_MIN/PY_LLONG_MAX.

5 years agobpo-14465: Add an indent() function to xml.etree.ElementTree to pretty-print XML...
Stefan Behnel [Fri, 23 Aug 2019 14:44:25 +0000 (16:44 +0200)]
bpo-14465: Add an indent() function to xml.etree.ElementTree to pretty-print XML trees (GH-15200)

5 years agotest_gdb: use unittest test discovery (GH-15405)
Victor Stinner [Fri, 23 Aug 2019 10:28:27 +0000 (11:28 +0100)]
test_gdb: use unittest test discovery (GH-15405)

Replace test.support.run_unittest() with unittest.main()
to automatically discover test cases, instead of having
an maintaing manually a list which may be incomplete.

Remove also an unused variable.

5 years agobpo-37531: Fix regrtest _timedout() function on timeout (GH-15419)
Victor Stinner [Fri, 23 Aug 2019 10:27:24 +0000 (11:27 +0100)]
bpo-37531: Fix regrtest _timedout() function on timeout (GH-15419)

Fix code handling TimeoutExpired exception in _timedout().

5 years agobpo-37926: Fix PySys_SetArgvEx(0, NULL, 0) crash (GH-15415)
Victor Stinner [Fri, 23 Aug 2019 10:04:16 +0000 (11:04 +0100)]
bpo-37926: Fix PySys_SetArgvEx(0, NULL, 0) crash (GH-15415)

empty_argv is no longer static in Python 3.8, but it is declared in
a temporary scope, whereas argv keeps a reference to it.
empty_argv memory (allocated on the stack) is reused by
make_sys_argv() code which is inlined when using gcc -O3.

Define empty_argv in PySys_SetArgvEx() body, to ensure
that it remains valid for the whole lifetime of
the PySys_SetArgvEx() call.

5 years agoCorrect minor grammar mistake (GH-15404)
Andre Delfino [Fri, 23 Aug 2019 09:58:27 +0000 (06:58 -0300)]
Correct minor grammar mistake (GH-15404)