Commit Graph

44936 Commits

Author SHA1 Message Date
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
Anthony Sottile 65366bc8bd bpo-20490: Improve circular import error message (GH-15308) 2019-09-09 08:17:50 -07: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
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
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
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
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 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
Ngalim Siregar 71ea688d66 bpo-11953: Extend table of Windows WSA* error codes (GH-15004) 2019-09-09 02:15:14 -07: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
Raymond Hettinger 4db25d5c39
bpo-36018: Address more reviewer feedback (GH-15733) 2019-09-08 16:57:58 -07:00
HongWeipeng 3c87a667bb bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)
This is a complement to PR 13375.
2019-09-08 13:15:56 +03:00
Dong-hee Na 9c4c459ac6 bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703) 2019-09-08 11:54:02 +03:00
Terry Jan Reedy 38da805d56
bpo-38041: Refine IDLE Shell restart lines. (GH-15709)
Restart lines now always start with '=' and never end with ' ' and fill the width of the window unless that would require ending with ' ', which could be wrapped by itself and possible confusing the user.
2019-09-06 13:54:45 -04:00
Victor Stinner 3f43ceff18
bpo-37064: Skip test_tools.test_pathfix if installed (GH-15705)
If Python is installed, skip test_tools.test_pathfix test because
Tools/scripts/pathfix.py script is not installed.
2019-09-05 18:09:46 +02:00
PatrikKopkan 50254ac4c1 bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548)
Add flag -k to pathscript.py script: preserve shebang flags.
2019-09-05 16:54:54 +02:00
Jon Janzen ce81a925ef bpo-36409: Remove old plistlib API deprecated in 3.4 (GH-15615)
* Remove implementation for old plistlib API deprecated in 3.4
2019-09-05 10:11:35 +02:00
Raymond Hettinger e4810b2a6c
bpo-36324: Apply review comments from Allen Downey (GH-15693) 2019-09-05 00:18:47 -07:00
Inada Naoki 8f9cc8771f
bpo-38026: fix inspect.getattr_static (GH-15676)
It should avoid dynamic lookup including `isinstance`.

This is a regression caused by GH-5351.
2019-09-05 13:07:08 +09:00
GeeTransit 2cd9025858 bpo-37902: IDLE: Add scrolling for IDLE browsers. (#15368)
Modify the wheel event handler so it can also be used for module, path, and stack browsers.
Patch by George Zhang.
2019-09-04 21:33:33 -04:00
Dong-hee Na 87bd2071c7 bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs (GH-15522)
https://bugs.python.org/issue22347
2019-09-04 17:34:35 -07:00
Terry Jan Reedy 6cd9666ce9
Fix idlelib.help comments (GH-15669) 2019-09-04 20:20:08 -04:00
Steve Dower 772ec0fad5
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681) 2019-09-04 14:42:54 -07:00
Greg Price 2f09413947 closes bpo-37966: Fully implement the UAX #15 quick-check algorithm. (GH-15558)
The purpose of the `unicodedata.is_normalized` function is to answer
the question `str == unicodedata.normalized(form, str)` more
efficiently than writing just that, by using the "quick check"
optimization described in the Unicode standard in UAX #15.

However, it turns out the code doesn't implement the full algorithm
from the standard, and as a result we often miss the optimization and
end up having to compute the whole normalized string after all.

Implement the standard's algorithm.  This greatly speeds up
`unicodedata.is_normalized` in many cases where our partial variant
of quick-check had been returning MAYBE and the standard algorithm
returns NO.

At a quick test on my desktop, the existing code takes about 4.4 ms/MB
(so 4.4 ns per byte) when the partial quick-check returns MAYBE and it
has to do the slow normalize-and-compare:

  $ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \
      -- 'unicodedata.is_normalized("NFD", s)'
  50 loops, best of 5: 4.39 msec per loop

With this patch, it gets the answer instantly (58 ns) on the same 1 MB
string:

  $ build.dev/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \
      -- 'unicodedata.is_normalized("NFD", s)'
  5000000 loops, best of 5: 58.2 nsec per loop

This restores a small optimization that the original version of this
code had for the `unicodedata.normalize` use case.

With this, that case is actually faster than in master!

$ build.base/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \
    -- 'unicodedata.normalize("NFD", s)'
500 loops, best of 5: 561 usec per loop

$ build.dev/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \
    -- 'unicodedata.normalize("NFD", s)'
500 loops, best of 5: 512 usec per loop
2019-09-03 19:45:44 -07:00
Tal Einat 580bdb0ece bpo-38022: IDLE: upgrade help.html to sphinx 2.x HTML5 output (GH-15664)
The HTML5 output from Sphinx 2.x adds  '<p>' tags within list elements.  Using a new prevtag attribute, ignore these instead of emitting unwanted '\n\n'.

Also stop looking for 'first' classes on tags (no longer present) and fix the bug of double-spacing instead of single spacing after <pre> blocks.
2019-09-03 16:52:58 -04:00
Tal Einat 132acaba5a bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634)
Extending the hover delay in test_tooltip should avoid spurious test_idle failures.
One longer delay instead of two shorter delays results in a net speedup.
2019-09-03 01:17:00 -04:00
Alan Yee efa3b51fd0 Enforce PEP 257 conventions in ftplib.py (GH-15604)
-`"""` over `'''`
-no blank line either before or after the docstring.
-place the closing quotes on a line by themselves
2019-09-02 21:21:33 -07:00
Jason R. Coombs 102e9b40ff
bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646)
Sync importlib.metadata with importlib_metadata 0.20.
2019-09-02 11:08:03 -04:00
Serhiy Storchaka 1f21eaa15e
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.
2019-09-01 12:16:51 +03:00
Serhiy Storchaka 5eca7f3f38
bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621) 2019-09-01 12:12:52 +03:00
Serhiy Storchaka eb8974616b
bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622) 2019-09-01 12:11:43 +03:00
Serhiy Storchaka f02ea6225b
bpo-36543: Remove old-deprecated ElementTree features. (GH-12707)
Remove methods Element.getchildren(), Element.getiterator() and
ElementTree.getiterator() and the xml.etree.cElementTree module.
2019-09-01 11:18:35 +03:00
Ashwin Ramaswami c5b242f87f 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
2019-08-31 08:25:35 -07:00
Min ho Kim 39d87b5471 Fix typos mostly in comments, docs and test names (GH-15209) 2019-08-30 16:21:19 -04:00
Terry Jan Reedy 15119bc2a7
IDLE: Fix 2 typos found by Min ho Kim. (GH-15617) 2019-08-30 16:16:37 -04:00
Victor Stinner 96b4087ce7
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.
2019-08-30 14:30:33 +02:00
Sergey Fedoseev 6a650aaf77 bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592) 2019-08-29 21:25:48 -07:00
Raymond Hettinger 496058f599
Steven Bethard designated a new maintainer for argparse (GH-15605) 2019-08-29 21:04:37 -07:00
Ned Deily 7fcc2088a5 bpo-37834: Prevent shutil.rmtree exception (GH-15602)
when built on non-Windows system without fd system call support,
like older versions of macOS.
2019-08-29 23:20:03 +02:00
Thomas A Caswell e278335a6e 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.
2019-08-29 18:30:04 +02:00
Rémi Lapeyre 4901fe274b bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593) 2019-08-29 17:49:08 +03:00
Joannah Nanjekye 2c5fb17118 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.
2019-08-29 14:54:46 +02:00
Raymond Hettinger 35f6301d68
bpo-10978: Semaphores can release multiple threads at a time (GH-15588) 2019-08-29 01:45:19 -07:00
Raymond Hettinger 0dac68f1e5
bpo-36743: __get__ is sometimes called without the owner argument (#12992) 2019-08-29 01:27:42 -07:00
Justin Blanchard 122376df55 bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307) 2019-08-29 10:36:15 +03:00
Serhiy Storchaka e64f948e76
bpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH-15510) 2019-08-29 09:30:23 +03:00
Serhiy Storchaka b235a1b473
bpo-37960: Silence only necessary errors in repr() of buffered and text streams. (GH-15543) 2019-08-29 09:25:22 +03:00
Rémi Lapeyre f5896a05ed bpo-35946: Improve assert_called_with documentation (GH-11796) 2019-08-29 02:15:53 -04:00
Xtreak c96127821e 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
2019-08-29 07:09:01 +01:00
Benjamin Peterson 465e5d5bcb
bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568) 2019-08-28 22:06:49 -07:00
Ronald Oussoren b0caf32981 bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736) 2019-08-29 00:33:52 -04:00
Vinay Sharma 13f37f2ba8 closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)
https://bugs.python.org/issue37964



Automerge-Triggered-By: @benjaminp
2019-08-28 18:56:17 -07:00
Anonymous Maarten 55aabee075 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
2019-08-28 10:11:03 -07:00
Daniel Fortunov 2a16eea71f bpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138) 2019-08-27 21:38:09 -07:00
Inada Naoki fae0ed5099
bpo-37328: remove deprecated HTMLParser.unescape (GH-14186)
It is deprecated since Python 3.4.
2019-08-27 11:48:06 +09:00