Commit Graph

21012 Commits

Author SHA1 Message Date
Ned Deily dfad352267 3.7.0rc1 2018-06-12 00:46:50 -04:00
Miss Islington (bot) a5db479ac4 bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530) (GH-7649)
The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were
misleading and partly wrong. It fails to explain that OpenSSL behaves
differently in client and server mode. Also OpenSSL does validate the
cert chain everytime. With SSL_VERIFY_NONE a validation error is not
fatal in client mode and does not request a client cert in server mode.
Also discourage people from using CERT_OPTIONAL in client mode.
(cherry picked from commit ef24b6c54d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-06-11 19:20:24 -04:00
Miss Islington (bot) 60b8274fec
bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)
(cherry picked from commit 46c5cd0f6e)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-06-11 13:44:16 -07:00
Miss Islington (bot) 144a8670f2
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
On Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should
make text and lines sharper. It should otherwise have no effect.

Using a magnifier, I determined that the improvement comes from horizontal and
lines being better lined up with the monitor pixels. I checked that this call causes
no problem on any Windows buildbot, including the Win7 buildbots. Unlike most
IDLE patches, this one can be easily reverted by users by removing a few lines,
at the top of idlelib/pyshell.py.
(cherry picked from commit 800415e3df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 11:35:13 -07:00
Miss Islington (bot) a9846e0c70 pypi.python.org -> pypi.org (GH-7613) (GH-7614)
(cherry picked from commit 9d6d06e806)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 01:05:22 -04:00
Miss Islington (bot) ec4343c3b4 bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731) (GH-7606)
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting.  This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
(cherry picked from commit 2487f30d55)

Co-authored-by: Steve Weber <steverweber@gmail.com>
2018-06-10 21:21:35 -04:00
Miss Islington (bot) 037e912552 bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7600)
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.
(cherry picked from commit 877b23202b)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2018-06-10 18:02:24 -04:00
Miss Islington (bot) 053d6c5ce2 bpo-33770: improve base64 exception message for encoded inputs of invalid length (GH-7416) (GH-7602)
(cherry picked from commit 1b85c71a21)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:37:14 -04:00
Miss Islington (bot) 066e16de8e Fix spaces added after hyphens in news entries. (GH-7579) (GH-7582)
Seems they were added by double applying blurb.
(cherry picked from commit 98a0e466cd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-10 14:53:21 -04:00
Michael Felt 20cd5c6e21 bpo-32493: Correct test for uuid_enc_be availability in configure.ac. (GH-7511) 2018-06-09 17:59:02 -04:00
Miss Islington (bot) dd613cf335
bpo-33409: Clarify PEP 538/540 relationship (GH-7534)
While locale coercion and UTF-8 mode turned out to
be complementary ideas rather than competing ones,
it isn't immediately obvious why it's useful to
have both, or how they interact at runtime.

This updates both the Python 3.7 What's New doc
and the PYTHONCOERCECLOCALE and PYTHONUTF8
documentation in an attempt to clarify that
relationship:

- in the respective What's New sections, add a closing paragraph
  explaining which problem each one solves, and pointing to the
  other PEP's section for the specific aspects it relies on the other
  PEP to solve
- use "locale-aware mode" as a more descriptive term for the
  default non-UTF-8 mode
- improve wording conistenccy between the PYTHONCOERCECLOCALE
  and PYTHONUTF8 docs when they cover the same thing (mostly
  related to legacy locale detection and setting the standard
  stream error handler)
- improve the description of the locale coercion trigger conditions
  (including pointing out that setting LC_ALL turns off locale coercion)
- port the full description of the UTF-8 mode behaviour changes
  from PEP 540 into the PYTHONUTF8 documentation
- be explicit that PYTHONIOENCODING still overrides the settings
  for the standard streams
- mention concrete examples of things that do and don't get their
  text encoding assumptions adjusted by the two text encoding
  assumption override techniques
(cherry picked from commit 1bcb8a6368)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
2018-06-09 00:13:53 -07:00
Miss Islington (bot) 21f4c780a1
bpo-30805: Avoid race condition with debug logging (GH-7545)
Supersedes https://github.com/python/cpython/pull/2490
(cherry picked from commit 12f482e0ae)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-08 15:42:07 -07:00
Miss Islington (bot) f4dcf49159
bpo-33736: Improve the documentation of asyncio stream APIs (GH-7326)
(cherry picked from commit c0d062f523)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-06-08 08:54:31 -07:00
Miss Islington (bot) 842985f6c7
bpo-11874: fix assertion failure in argparse metavar handling (GH-1826)
- bugfix and test for fragile metavar handling in argparse (see
  bpo-24089, bpo-14046, bpo-25058, bpo-11874)
- also fixes some incorrect tests that did not make 1-element tuples correctly
(cherry picked from commit 66f02aa32f)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-06-08 04:33:50 -07:00
Miss Islington (bot) a4868473e7
bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
(cherry picked from commit 041272b657)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-07 22:50:36 -07:00
Miss Islington (bot) 0738443a5b
bpo-33792: Add selector and proactor windows policies (GH-7487)
(cherry picked from commit 8f4042964d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-07 18:31:50 -07:00
Miss Islington (bot) a971a6fdb1 bpo-33803: Fix a crash in hamt.c (GH-7504) (GH-7505)
(cherry picked from commit 378c53cc31)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-07 20:44:09 -04:00
Miss Islington (bot) ab5da50d82
bpo-33642 and bpo-33679: Revise and condense blurbs (GH-7500)
(cherry picked from commit bed523ba03)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-07 16:30:19 -07:00
Miss Islington (bot) 8fa398d5ce bpo-33694: Fix race condition in asyncio proactor (GH-7498) (GH-7499)
The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.

No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.

Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.

Move _feed_data_to_bufferred_proto() to protocols.py.

Remove set_protocol() method which became useless.
(cherry picked from commit 79790bc35f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-08 00:49:34 +02:00
Miss Islington (bot) 4705ea38c9 update to Unicode 11.0.0 (closes bpo-33778) (GH-7439) (GH-7470)
Also, standardize indentation of generated tables.
(cherry picked from commit 7c69c1c0fb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-06-07 03:36:22 -04:00
Miss Islington (bot) d6e789c402
bpo-5755: Move -Wstrict-prototypes to CFLAGS_NODIST (GH-7395)
(cherry picked from commit e336484847)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-06-05 17:12:06 -07:00
Miss Islington (bot) 79c7e57c46 bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403) (GH-7428)
In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
(cherry picked from commit 415bc46a78)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-05 10:18:20 -04:00
Miss Islington (bot) 631fe1fa42
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)
Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976057)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-05 06:21:04 -07:00
Miss Islington (bot) 103058e19b
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
(cherry picked from commit 2a4a62ba4a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-06-04 13:41:49 -07:00
Miss Islington (bot) 150033d159
bpo-31849: Fix warning in pyhash.c (GH-6799)
(cherry picked from commit a8eb58546b)

Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
2018-06-04 10:31:07 -07:00
Miss Islington (bot) b7eb1024d0
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
(cherry picked from commit b609e687a0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:33:23 -07:00
Miss Islington (bot) 87936d03cb bpo-33734: asyncio/ssl: a bunch of bugfixes (GH-7321) (GH-7396)
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)

* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
(cherry picked from commit 9602643120)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-04 12:05:46 -04:00
Miss Islington (bot) cfc12ec68c
bpo-33664: Scroll IDLE editor text by lines (GH-7351)
Previously, the mouse wheel and scrollbar slider moved text by a fixed
number of pixels, resulting in partial lines at the top of the editor
box. The change also applies to the shell and grep output windows,
but not to read-only text views.
(cherry picked from commit d49dbd9acc)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:05:24 -07:00
Miss Islington (bot) 4e033c5aa1
bpo-33679: IDLE: Re-enable color configuration for code context (GH-7199)
The difference from before is that the settings are now on the
Highlights tab instead of the Extensions tab and only change one theme
at a time instead of all themes. The default for light themes is black
on light gray, as before. The default for the IDLE Dark theme is white
on dark gray, which better fits the dark theme.

When one starts IDLE from a console and loads a custom theme without
definitions for 'context', one will see a warning message on the console.
To stop the warning, go to Options => Configure IDLE => Highlights,
select the custom theme if not selected already, select 'Code Context',
and select foreground and background colors.
(cherry picked from commit de6516264e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 19:16:04 -07:00
Miss Islington (bot) 0800b6c17a
bpo-33642: IDLE: Use variable number of lines in CodeContext. (GH-7106)
Instead of displaying a fixed number of lines, some blank, Code Context
now displays the variable number of actual context lines.  When there
are no context lines, it shows a single blank line to indicate that the
feature is turned on.

The Code Context configuration option is changed from 'numlines'
(default 3) to 'maxlines' (default 15) to avoid possible interference
between user settings for the old and new versions of Code Context.
(cherry picked from commit 29996a1c4e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 16:45:54 -07:00
Miss Islington (bot) 623b439abe bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal (GH-7146) (GH-7306)
(cherry picked from commit e905c84494)

Co-authored-by: pkerling <pkerling@casix.org>
2018-06-01 12:50:24 +02:00
Miss Islington (bot) c6de46e180
bpo-33706: Fix pymain_parse_cmdline_impl() (GH-7283)
Fix a crash in Python initialization when parsing the command line
options.

Fix memcpy() size parameter: previously, we read one wchar_t after
the end of _PyOS_optarg. Moreover, don't copy the trailingg NUL
character: we write it manually anyway.

Thanks Christoph Gohlke for the bug report and the fix!
(cherry picked from commit 58d1683255)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-31 06:43:21 -07:00
Ned Deily e76b8c4464
Fix "ditribution" typo in NEWS entry. (GH-7275) 2018-05-31 01:19:58 -04:00
Ned Deily abb8802389 3.7.0b5 2018-05-30 19:50:49 -04:00
Miss Islington (bot) f95269404c [3.7] bpo-23859: Document that asyncio.wait() does not cancel its futures (GH-7217) (#7227)
* bpo-23859: Document that asyncio.wait() does not cancel its futures (GH-7217)

Unlike `asyncio.wait_for()`, `asyncio.wait()` does not cancel the passed
futures when a timeout accurs.
(cherry picked from commit f9aeca2085)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>

* Update asyncio-task.rst
2018-05-29 21:26:22 -04:00
Yury Selivanov af9cda9845
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (GH-7233)
This reverts commit 2a7eb0b531.
2018-05-29 20:56:33 -04:00
Miss Islington (bot) d8948c5e09
bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)
Currently, asyncio.wait_for(fut), upon reaching the timeout deadline,
cancels the future and returns immediately.  This is problematic for
when *fut* is a Task, because it will be left running for an arbitrary
amount of time.  This behavior is iself surprising and may lead to
related bugs such as the one described in bpo-33638:

    condition = asyncio.Condition()
    async with condition:
        await asyncio.wait_for(condition.wait(), timeout=0.5)

Currently, instead of raising a TimeoutError, the above code will fail
with `RuntimeError: cannot wait on un-acquired lock`, because
`__aexit__` is reached _before_ `condition.wait()` finishes its
cancellation and re-acquires the condition lock.

To resolve this, make `wait_for` await for the task cancellation.
The tradeoff here is that the `timeout` promise may be broken if the
task decides to handle its cancellation in a slow way.  This represents
a behavior change and should probably not be back-patched to 3.6 and
earlier.
(cherry picked from commit e2b340ab41)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-05-29 15:37:06 -07:00
Miss Islington (bot) 036434273e bpo-32684: Fix gather to propagate cancel of itself with return_exceptions (GH-7209) (#7222)
(cherry picked from commit 863b674909)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 18:29:12 -04:00
Miss Islington (bot) 2a7eb0b531
bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)
Original patch by Dan O'Reilly.
(cherry picked from commit 5d97b7bcc1)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 14:09:17 -07:00
Miss Islington (bot) cb055bcc2b bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) (GH-7204)
(cherry picked from commit a9cab433bb)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-05-29 11:43:54 -04:00
Miss Islington (bot) be5d616e55
bpo-33654: Support protocol type switching in SSLTransport.set_protocol() (GH-7194)
(cherry picked from commit 2179022d94)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 02:19:09 -07:00
Serhiy Storchaka 2641ee5040
bpo-32911: Revert bpo-29463. (GH-7121)
Remove the docstring attribute of AST types and restore docstring
expression as a first stmt in their body.

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-05-29 10:49:10 +03:00
Miss Islington (bot) eca085993c
bpo-33674: Pause the transport as early as possible (GH-7192)
(cherry picked from commit f295587c45)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 22:59:03 -07:00
Miss Islington (bot) 0dd8fd0358 bpo-33674: asyncio: Fix SSLProtocol race (GH-7175) (#7187)
Fix a race condition in SSLProtocol.connection_made() of
asyncio.sslproto: start immediately the handshake instead of using
call_soon(). Previously, data_received() could be called before the
handshake started, causing the handshake to hang or fail.
(cherry picked from commit be00a5583a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-28 21:44:16 -04:00
Miss Islington (bot) 420092e255 bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172) (#7182)
(cherry picked from commit 7165754b6b)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 21:42:45 -04:00
Miss Islington (bot) ddc613f203
bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)
(cherry picked from commit 416c1ebd98)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 17:16:43 -07:00
Miss Islington (bot) 8d8b86116f
bpo-33469: RuntimeError after closing loop that used run_in_executor (GH-7171)
(cherry picked from commit fdccfe09f0)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 15:50:02 -07:00
Miss Islington (bot) 075c662086 bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines (GH-7161) (GH-7173)
(cherry picked from commit 989b9e0e6d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 18:31:07 -04:00
Miss Islington (bot) 3757939e9c
bpo-33614: Ensures module definition files for the stable ABI on Windows are correctly regenerated. (GH-7165)
(cherry picked from commit e97ba4c690)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-05-28 12:51:16 -07:00
Miss Islington (bot) bc3a002e7d
bpo-33654: Support BufferedProtocol in set_protocol() and start_tls() (GH-7130)
In this commit:

* Support BufferedProtocol in set_protocol() and start_tls()
* Fix proactor to cancel readers reliably
* Update tests to be compatible with OpenSSL 1.1.1
* Clarify BufferedProtocol docs
* Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving
* Rewrite test_start_tls_server_1
(cherry picked from commit dbf102271f)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 11:50:45 -07:00