Commit Graph

105264 Commits

Author SHA1 Message Date
Miss Islington (bot) 44729c9f51
bpo-32587: Fixes unsafe downcast in PC/winreg.c (GH-15766)
(cherry picked from commit ef66f31ce2)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-09 07:23:37 -07:00
Steve Dower 5d695b6b7b
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 06:48:22 -07:00
Miss Islington (bot) 5e053eb98e
Fix typo in math.prod example (GH-15614)
(cherry picked from commit 1a8de82d3a)

Co-authored-by: Ashwin Vishnu <9155111+ashwinvis@users.noreply.github.com>
2019-09-09 06:42:50 -07:00
Miss Islington (bot) 248387f3f1
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.
(cherry picked from commit b4612f5d54)

Co-authored-by: T. Wouters <thomas@python.org>
2019-09-09 06:28:07 -07:00
Miss Islington (bot) 2a4a982cbc
bpo-37283: Ensure command-line and unattend.xml setting override previously detected states in Windows installer (GH-15759)
(cherry picked from commit 3a0ddbcdfc)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-09 06:02:42 -07:00
Miss Islington (bot) 12acb5b9c8
bpo-34652 again: Remove lchmod from the default AC_CHECK_FUNCS list. (GH-15758)
(cherry picked from commit bed04b6647)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-09 06:01:41 -07:00
Miss Islington (bot) bee8bfe5f4
bpo-37212: Preserve keyword argument order in unittest.mock.call and error messages (GH-14310)
(cherry picked from commit 9d607061c9)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-09 04:42:43 -07:00
Miss Islington (bot) 252267925d
[3.8] Doc: Fix PDF build (NoUri). (GH-15739) (GH-15754)
(cherry picked from commit 63c98ed2d2)


Co-authored-by: Julien Palard <julien@palard.fr>

Automerge-Triggered-By: @JulienPalard
2019-09-09 04:29:10 -07:00
Miss Islington (bot) 87a5a331ea
bpo-36250: ignore ValueError from signal in non-main thread (GH-12251)
Authored-By: blueyed <github@thequod.de>
(cherry picked from commit 8d64bfafdf)

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-09-09 04:25:21 -07:00
Miss Islington (bot) 68e401fa0b
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.
(cherry picked from commit 19052a1131)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:37:55 -07:00
Steve Dower eb02196bd9
bpo-11953: Extend table of Windows WSA* error codes (GH-15004) 2019-09-09 03:36:04 -07:00
Miss Islington (bot) c837ad408e
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
(cherry picked from commit 5e5e951502)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-09 03:25:04 -07:00
Miss Islington (bot) ebca7eb093
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
* bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations

* Address review comments.
(cherry picked from commit e223ba13d8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:11:00 -07:00
Zachary Ware 14f7de72b6
[3.8] bpo-15817: gdbinit: Document commands after defining them (GH-15021) (#15744)
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.
(cherry picked from commit 1f86fdcfc5)

Authored-by: Florian Bruhin <me@the-compiler.org>
2019-09-09 04:56:38 -05:00
Miss Islington (bot) e103732f5d
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.
(cherry picked from commit a6563650c8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 02:50:30 -07:00
Miss Islington (bot) 6e3809c7ce
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
(cherry picked from commit 526a01467b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-09 02:07:51 -07:00
Raymond Hettinger cc1bdf91d5
[3.8] bpo-36018: Address more reviewer feedback (GH-15733) (GH-15734) 2019-09-08 18:40:06 -07:00
Serhiy Storchaka 3be4b10749
[3.8] Correct Roman-numeral example in Unicode HOWTO. (GH-15541). (GH-15728)
(cherry picked from commit 32a960f8e1)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-08 13:17:24 +03:00
Miss Islington (bot) cc51a6d7c7
bpo-20806: Reference both times(2) and times(3) and link to MSDN. (GH-15479)
(cherry picked from commit 3ccdbc3338)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2019-09-07 00:12:34 -07:00
Miss Islington (bot) 4009a8522d
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.
(cherry picked from commit 38da805d56)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-06 11:14:49 -07:00
Miss Islington (bot) 4d1abedce9 bpo-37380: subprocess: don't use _active on win (GH-14360) (GH-15707)
As noted by @eryksun in [1] and [2], using _cleanup and _active(in
__del__) is not necessary on Windows, since:

> Unlike Unix, a process in Windows doesn't have to be waited on by
> its parent to avoid a zombie. Keeping the handle open will actually
> create a zombie until the next _cleanup() call, which may be never
> if Popen() isn't called again.

This patch simply defines `subprocess._active` as `None`, for which we already
have the proper logic in place in `subprocess.Popen.__del__`, that prevents it
from trying to append the process to the `_active`. This patch also defines
`subprocess._cleanup` as a noop for Windows.

[1] https://bugs.python.org/issue37380GH-msg346333
[2] https://bugs.python.org/issue36067GH-msg336262

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
(cherry picked from commit 042821ae3c)

Co-authored-by: Ruslan Kuprieiev <kupruser@gmail.com>
2019-09-06 11:14:31 +02:00
Miss Islington (bot) b8c66779c7 More refinements to the statistics docs (GH-15713) (GH-15715)
(cherry picked from commit d8c93aa5d2)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-09-05 23:19:13 -07:00
Miss Islington (bot) 7eaeddad75
Correct minor gramatical mistake in sys.settrace doc (GH-15637)
(cherry picked from commit 3038e87ba8)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2019-09-05 04:17:41 -07:00
Miss Islington (bot) f5649bfe76 bpo-36324: Apply review comment from Jake Vanderplas (GH-15695) (GH-15696)
(cherry picked from commit 9b51570ffd)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-09-05 01:10:40 -07:00
Miss Islington (bot) dafbe32656 bpo-36324: Apply review comments from Allen Downey (GH-15693) (GH-15694)
(cherry picked from commit e4810b2a6c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-09-05 00:42:22 -07:00
Miss Islington (bot) bdcbb83c66
bpo-38026: fix inspect.getattr_static (GH-15676)
It should avoid dynamic lookup including `isinstance`.

This is a regression caused by GH-5351.
(cherry picked from commit 8f9cc8771f)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-09-04 21:25:59 -07:00
Miss Islington (bot) 9c2654d1aa
bpo-37902: IDLE: Add scrolling for IDLE browsers. (GH-15368)
Modify the wheel event handler so it can also be used for module, path, and stack browsers.
Patch by George Zhang.
(cherry picked from commit 2cd9025858)

Co-authored-by: GeeTransit <geetransit@gmail.com>
2019-09-04 18:53:47 -07:00
Abhilash Raj 6ad0a2c45f
[3.8] bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239) (GH-15686)
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
(cherry picked from commit c5b242f87f)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2019-09-04 18:20:40 -07:00
Miss Islington (bot) 6d7a786d2e
bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs (GH-15522)
https://bugs.python.org/issue22347
(cherry picked from commit 87bd2071c7)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-09-04 17:54:59 -07:00
Miss Islington (bot) 29825a3392
Fix idlelib.help comments (GH-15669)
(cherry picked from commit 6cd9666ce9)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-04 17:39:34 -07:00
Miss Islington (bot) cad7abf8ab
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)
(cherry picked from commit 772ec0fad5)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-04 15:18:05 -07:00
Miss Islington (bot) 5e194f57c0
Fix grammar in asyncio-dev.rst (GH-15672)
Automerge-Triggered-By: @ned-deily
(cherry picked from commit 675d17cec4)

Co-authored-by: Roger Iyengar <ri@rogeriyengar.com>
2019-09-03 23:10:45 -07:00
Miss Islington (bot) 4dd1c9d9c2
closes bpo-37966: Fully implement the UAX GH-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 GH-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
(cherry picked from commit 2f09413947)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-03 20:03:37 -07:00
Miss Islington (bot) 952ea67289
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.
(cherry picked from commit 580bdb0ece)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-09-03 14:18:45 -07:00
Miss Islington (bot) 54dac6c0f4
bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
(cherry picked from commit 993ac92418)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-03 13:13:41 -07:00
Ashwin Ramaswami 59e8fba718 [3.8] bpo-21315: Fix parsing of encoded words with missing leading ws (GH-13425) (GH-15655)
* [bpo-21315](https://bugs.python.org/issue21315): Fix parsing of encoded words with missing leading ws.

Because of missing leading whitespace, encoded word would get parsed as
unstructured token. This patch fixes that by looking for encoded words when
splitting tokens with whitespace.

Missing trailing whitespace around encoded word now register a defect
instead.

Original patch suggestion by David R. Murray on [bpo-21315](https://bugs.python.org/issue21315).
(cherry picked from commit 66c4f3f38b)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
(cherry picked from commit dc20fc4311)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>





https://bugs.python.org/issue21315
2019-09-03 10:08:39 -07:00
Miss Islington (bot) 58067d2cf6 bpo-37798: Fix _statistics module doc (GH-15546)
(cherry picked from commit 0cf832a9ef)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-09-03 13:21:59 +03:00
Miss Islington (bot) 1c18aec3bb
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.
(cherry picked from commit 132acaba5a)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-09-02 22:39:08 -07:00
Miss Islington (bot) b365cfae46 bpo-36853: Fix suspicious.py to actually print the unused rules (GH-13579) (GH-15649)
* Fix suspicious.py to actually print the unused rules

* Fix the other `self.warn` calls
(cherry picked from commit e1786b5416)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-09-02 12:12:19 -04:00
Miss Islington (bot) bf69e160c4 bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646) (GH-15648)
Sync importlib.metadata with importlib_metadata 0.20.
(cherry picked from commit 102e9b40ff)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-02 12:11:01 -04:00
Serhiy Storchaka 353053d9ad
[3.8] bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630) (GH-15635)
Only AttributeError should be silenced.
(cherry picked from commit 41c57b3353)
2019-09-01 14:01:05 +03:00
Miss Islington (bot) 6922b9e4fc bpo-37977: Warn more strongly and clearly about pickle security (GH-15595) (GH-15629)
(cherry picked from commit daa82d019c)

Co-authored-by: Daniel Pope <lordmauve@users.noreply.github.com>
2019-08-30 23:02:15 -07:00
Inada Naoki 97a31c7b48
[3.8] bpo-37990: fix gc stats (GH-15626)
(cherry picked from commit 013e52f)
2019-08-31 10:50:27 +09:00
Raymond Hettinger bd8ca9aacc
[3.8] bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups (GH-14976) (GH-15494) (GH-15624) 2019-08-30 15:25:38 -07:00
Miss Islington (bot) 4bd1d05ee2
Fix typos mostly in comments, docs and test names (GH-15209)
(cherry picked from commit 39d87b5471)

Co-authored-by: Min ho Kim <minho42@gmail.com>
2019-08-30 13:42:54 -07:00
Miss Islington (bot) 3d75857dfa
IDLE: Fix 2 typos found by Min ho Kim. (GH-15617)
(cherry picked from commit 15119bc2a7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-08-30 13:36:06 -07:00
Miss Islington (bot) 17f61ed25a
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.
(cherry picked from commit 96b4087ce7)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-08-30 05:50:44 -07:00
Łukasz Langa 1553e3b5fc
Post v3.8.0b4 2019-08-30 11:01:34 +02:00
Łukasz Langa 23d532a435 Python 3.8.0b4
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl1oSsoACgkQsmmV4xAl
 BWiZ2w/9EGp9XonU8NCJShlmjmat3q1S1FKQD69W4817cQRNtj8Lv6UP17epkVtX
 8ASRA5IdUuMhU30A6eUMmk0HmVjTDvxQTCpC0qSa1gDxd6vysydTDOmxyoRExR5R
 secZIYswJVsKUGyiR0+aOaOqDJSS4zUMLttdBeiEKwZEXyXntqOStB3nx/lURKkM
 wLzQM0N7HQKvqY9lc3ANQ12LcD9rpj9xn4dx3mauINNOJlA1sy3ymt/6iiRJlYYC
 LwoahzS8q1TSvz6X/E0kHZ3cZ//uiAgDF9XpuDUm5bwKwClHm5hxnDF53do6FP3V
 u4CIDNySksrvxha+5F9Y8Ln9M8t2pjfl+XzKMPoEb7pGugV8TAhnWdRk0CO6FkS4
 ApLiY0CsxrB+vpQxOVBwIchqM9QXXf6kZxh8T/R1qkFRpThepLNGR87rXEuZLt+I
 HjJPgiC1gvyiVESvzMFllMbCq1syjrONsvRQOjL4NhrdjH+xPuscuNZlgClwW1uz
 plIScSsAZyPI22Vs55ppLpxo8gU8y87i4nHBr82asc4e84R1gWqlrQbnut6Q7r38
 cT41RKlMgY5YG41L/hUaYPyWXhIbYXk3KTyi0FW+ShPQriFaL348XWJTpfDupSZh
 rv7Bnh4JGUkmDw988VMCL9WbWDdo9gZjJPeHuI8MHWrO3ZP8130=
 =O/oH
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl1o5dYQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaLU6D/9botf8rulCYHS799GjFWt9kjBycZYhUJij
 +pDLDm+ORq50eJnQYYgE3eTFLhRO7IypnIf1eSoFv/pxxDgWdqsKLoLRA8qjCjc6
 PBmK2w88QBpDpX54B5yZrwFihlH9xRZSOmKAepOkDDa1VTUUiID2Wo+ZGG6+yjmg
 EV6vdWBVTDbHTRND5d/mP7AZ+n/LAN1SUwO4QCIsLXLb/8L+1CLs2/7iOWEvu5TP
 4DGO0D3e+kZv67EnrJB3mlxwgSupEnHwiNg0GL8NoFA4WRXMNx5l8QmhQuwj1ybz
 NbhbR8pZIejBrJE7Va58g6Yg5/7qTHNFSnsNT9o5OFBNahLzqB6/aNspyn+Wyb3b
 KsfirTXGCdau4ufDJWLRXTn/OkmbG141F5p82BXoPr4NMchdcAivVQbWMB2QvZ/D
 8S6AcUIscmD8uY+UT1d2fq0gxXPIf8+oXOqhlZ3TypnFuQKtEMU0htytvVVvEtJo
 PTs0mGxLq56/bvAE56lLuW5wJLXJOGZ9JSW6HqiYNEcEcotwY/RvraQ4TuTwHu5f
 /ZKIzAYJ+WwalVQDXky6rUd4xFOiQ0xeAz+hvdRAf9RtIMfOQUGQz8pv0x6m5ULO
 FBRJArkT+OYpAODFJDg1dvy1PWKSb9RRZC1HoZx1Hgk92hUtpliVQ/Rmh7jpE+0G
 M6l5t87ofA==
 =hIaU
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.0b4' into 3.8

Python 3.8.0b4
2019-08-30 11:01:00 +02:00
Miss Islington (bot) 27f418640c bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592) (GH-15608)
(cherry picked from commit 6a650aaf77)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2019-08-29 23:23:17 -07:00