Commit Graph

99950 Commits

Author SHA1 Message Date
Terry Jan Reedy adb4cd2a2a bpo-27099: Finish updating IDLE doc and help text. (#3510)
As needed for the conversion of extensions to features.
2017-09-12 07:45:15 -04:00
Eric Snow fc1bf872e9 bpo-30860: Move windows.h include out of internal/*.h. (#3458)
PR #3397 introduced a large number of warnings to the Windows build. This patch fixes them.
2017-09-11 18:30:43 -07:00
Eric Snow 8728018624 bpo-30860: Fix a refleak. (#3506)
* Drop warnoptions from PyInterpreterState.

* Drop xoptions from PyInterpreterState.

* Don't set warnoptions and _xoptions again.

* Decref after adding to sys.__dict__.

* Drop an unused macro.

* Check sys.xoptions *before* we delete it.
2017-09-11 17:59:22 -07:00
Eric Snow ba6d5d1def bpo-30860: Always provide serialno. (#3507)
This fixes bpo-31407.
2017-09-11 17:02:24 -07:00
Oren Milman 9d984fd2b0 bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (#3496)
Patch by Oren Milman.
2017-09-12 00:18:09 +03:00
Terry Jan Reedy 8239fd7046 bpo-30928: Update idlelib/NEWS.txt to 2017-09-11. (#3503) 2017-09-11 16:43:26 -04:00
Terry Jan Reedy 667522efa8 bpo-31414: IDLE -- fix tk entry box tests by deleting first. (#3501)
Adding to an int entry is not the same as deleting and inserting
because int('') will fail.
2017-09-11 16:02:33 -04:00
Victor Stinner 4866957e86 bpo-30860: Add Include/internal/ in "make tags" (#3498) 2017-09-11 09:34:36 -07:00
Victor Stinner 50a72af657 test_ssl: Implement timeout in ssl_io_loop() (#3500)
The timeout parameter was not used.
2017-09-11 09:34:24 -07:00
Zackery Spytz 834a5cecac Remove a null statement that was necessary for --without-threads (#3478) 2017-09-11 12:37:10 +02:00
Benjamin Peterson 2bb69a5b4e bpo-31373: remove overly strict float range checks (#3486)
This undoes a853a8ba78 except for the pytime.c
parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be
rounded into finite floats. Tests were added to very this behavior.
2017-09-10 23:50:46 -07:00
Oren Milman 252033d50e bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (#3485) 2017-09-11 09:28:39 +03:00
Cheryl Sabella 3866d9bbcf bpo-30781: IDLE: Fix help button on configdialog (#3238)
This fixes an omission in the ttk conversion patch for this issue, hence no new news.
Patch by Cheryl Sabella.
2017-09-10 22:41:10 -04:00
wohlganger 58fc71c447 bpo-27099: IDLE - Convert built-in extensions to regular features (#2494)
About 10 IDLE features were implemented as supposedly optional
extensions.  Their different behavior could be confusing or worse for
users and not good for maintenance.  Hence the conversion.

The main difference for users is that user configurable key bindings
for builtin features are now handled uniformly.  Now, editing a binding
in a keyset only affects its value in the keyset.  All bindings are
defined together in the system-specific default keysets in config-
extensions.def.  All custom keysets are saved as a whole in config-
extension.cfg.  All take effect as soon as one clicks Apply or Ok.

The affected events are '<<force-open-completions>>', '<<expand-word>>',
'<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>',
'<<run-module>>', '<<check-module>>', and '<<zoom-height>>'.  Any
(global) customizations made before 3.6.3 will not affect their keyset-
specific customization after 3.6.3. and vice versa.

Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.
2017-09-10 17:19:47 -04:00
Antoine Pitrou d39dbf4cf1 Simplify run_tests.py (#3482) 2017-09-10 20:32:13 +02:00
Raymond Hettinger 8b57d73639 bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() (#3454)
* Working draft without _source

* Re-use itemgetter() instances

* Speed-up calls to __new__() with a pre-bound tuple.__new__()

* Add note regarding string interning

* Remove unnecessary create function wrappers

* Minor sync-ups with PR-2736.  Mostly formatting and f-strings

* Bring-in qualname/__module fix-ups from PR-2736

* Formally remove the verbose flag and _source attribute

* Restore a test of potentially problematic field names

* Restore kwonly_args test but without the verbose option

* Adopt Inada's idea to reuse the docstrings for the itemgetters

* Neaten-up a bit

* Add news blurb

* Serhiy pointed-out the need for interning

* Jelle noticed as missing f on an f-string

* Add whatsnew entry for feature removal

* Accede to request for dict literals instead keyword arguments

* Leave the method.__module__ attribute pointing the actual location of the code

* Improve variable names and add a micro-optimization for an non-public helper function

* Simplify by in-lining reuse_itemgetter()

* Arrange steps in more logical order

* Save docstring in local cache instead of interning
2017-09-10 10:23:36 -07:00
Stefan Krah 3cedf46cdb bpo-31406: Fix crash due to lack of type checking in subclassing. (#3477) 2017-09-10 18:08:04 +02:00
Zhiming Wang 30644dee0c Improve IncrementalEncoder documentation (GH-2746)
getstate and setstate are instance methods, same as encode and reset.
2017-09-09 23:09:55 -07:00
Stefan Krah c0c29dff79 bpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474) 2017-09-09 19:26:22 +02:00
Sergey Fedoseev a7fbad96c8 Make `json.dumps()` example to be PEP-8 compliant. (GH-3472) 2017-09-09 09:39:36 -07:00
Steve Dower b84bcc48ae bpo-31392: Update SSL build for 1.1.0 (#3448) 2017-09-09 06:13:06 -07:00
Gregory P. Smith efb1d0a3c0 bpo-29639: change test.support.HOST to "localhost"
test.support.HOST should be "localhost" as it was in the past. See the bpo-29639.

Tests that need the IP address should use HOSTv4 (added) or the existing HOSTv6 constant.

This changes the definition and fixes tests that needed updating to deal with HOST being
the hostname rather than the hardcoded IP address.

This is only the first step in addressing https://bugs.python.org/issue29639.
2017-09-09 00:30:15 -07:00
Han Lee 829dacce4f bpo-26669: Fix nan arg value error in pytime.c (#3085)
* Fix #26669

* Modify NaN check function and error message

* Fix pytime.c when arg is nan

* fix whitespace
2017-09-08 16:05:05 -07:00
Steve Dower e6eb48c10d bpo-31400: Improve SSL error handling on Windows (#3463)
* bpo-31392: Improve SSL error handling on Windows

* Remove unnecessary Windows mention in NEWS
2017-09-08 15:16:15 -07:00
Christian Heimes 0915360b9e bpo-28182: restore backwards compatibility (#3464)
b3ad0e5 broke backwards compatibility with OpenSSL < 1.0.2.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-08 14:47:58 -07:00
Benjamin Peterson db610e909b delete dead locale initialization code for windows (#3461) 2017-09-08 14:30:07 -07:00
octaviansoldea 4c81401b3a bpo-31354: Let configure --with-lto work on all builds
Allow configure --with-lto to apply to all builds, not just profile-opt builds.

Whether this is actually useful or not must be determined by the person
building CPython using their own toolchain.

My own quick test on x86_64 Debian 9 (gcc 6.3, binutils 2.28) seemed
to suggest that it wasn't, but I expect better toolchains can or will exist
at some point.  The point is to allow it at all.
2017-09-08 12:14:33 -07:00
Christian Heimes b3ad0e5127 bpo-28182: Expose OpenSSL verification results (#3412)
The SSL module now raises SSLCertVerificationError when OpenSSL fails to
verify the peer's certificate. The exception contains more information about
the error.

Original patch by Chi Hsuan Yen

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-08 12:00:19 -07:00
Steve Dower af8d6b9072 Fixes reference leak (#3457) 2017-09-08 11:35:38 -07:00
Benjamin Peterson 2b7953d974 replace custom table with pyctype (#3456) 2017-09-08 10:35:49 -07:00
Serhiy Storchaka e3b2b4b8d9 bpo-31393: Fix the use of PyUnicode_READY(). (#3451) 2017-09-08 09:58:51 +03:00
Raymond Hettinger 70c2dd306f Show example of itemgetter() applied to a dictionary (#3431) 2017-09-07 23:53:07 -07:00
Benjamin Peterson 8e0ad46bc8 update all_name_chars comment after 9020ac7cce (#3452) 2017-09-07 23:35:53 -07:00
Eric Snow 2ebc5ce42a bpo-30860: Consolidate stateful runtime globals. (#3397)
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals

Other globals are excluded (see globals.txt and check-c-globals.py).
2017-09-07 23:51:28 -06:00
Steve Dower bab21faded Updates PCBuild/readme.txt (#3418) 2017-09-07 20:10:29 -07:00
Christian Heimes cb5b68abde bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (#1363)
* bpo-29136: Add TLS 1.3 support

TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3
cipher suites don't overlap with cipher suites from TLS 1.2 and earlier.
Since Python sets its own set of permitted ciphers, TLS 1.3 handshake
will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common
AES-GCM and ChaCha20 suites.

Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with
OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3
now.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-07 18:07:00 -07:00
Benjamin Peterson 9020ac7cce optimize all_name_chars (#3442)
Remove redundant PyUnicode_Check call. Use a static table for checking chars.
2017-09-07 18:06:23 -07:00
Ned Deily 590665c399 bpo-31036: Allow sphinx and blurb to be found automatically (#3440)
Rather than requiring the path to blurb and/or sphinx-build to be specified to the make rule, enhance the Doc/Makefile to look for each first in a virtual environment created by make venv and, if not found, look on the normal process PATH. This allows the Doc/Makefile to take advantage of an installed spinx-build or blurb and, thus, do the right thing most of the time. Also, make the directory for the venv be configurable and document the `make venv` target.
2017-09-07 17:17:53 -07:00
Nick Coghlan 5a8516701f bpo-31344: Per-frame control of trace events (GH-3417)
f_trace_lines: enable/disable line trace events
f_trace_opcodes: enable/disable opcode trace events

These are intended primarily for testing of the interpreter
itself, as they make it much easier to emulate signals
arriving at unfortunate times.
2017-09-08 10:14:16 +10:00
Gregory P. Smith 2eb0cb4787 bpo-22635: Update the getstatusoutput docstring. (#3435)
To match the documentation updates already made.
Also renames the local variable used within to match
what it actually holds.
2017-09-07 16:11:02 -07:00
Christian Heimes 888bbdc192 bpo-27340: Use memoryview in SSLSocket.sendall() (#3384)
* bpo-27340: Use memoryview in SSLSocket.sendall()

SSLSocket.sendall() now uses memoryview to create slices of data. This fix
support for all bytes-like object. It is also more efficient and avoids
costly copies.

Signed-off-by: Christian Heimes <christian@python.org>

* Cast view to bytes, fix typo

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-07 14:18:21 -07:00
Christian Heimes 17c9ac927b bpo-28958: Improve SSLContext error reporting. (#3414)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-07 14:14:00 -07:00
Raymond Hettinger 3147b0422c bpo-31270: Modification of Pr 3200 (#3427)
* bpo-31270: Simplify documentation of itertools.zip_longest

* Use repeat(). Track num_active.
2017-09-07 14:01:44 -07:00
Christian Heimes 0c72a0c449 Update copyright PSF to 2001-2017 (#3421)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-07 13:59:13 -07:00
Pablo Galindo 586c0502b5 bpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples (#3229)
* Fix ZeroMQSocketListener and ZeroMQSocketHandler examples

* Use send_json and recv_json to simplify pyzmq interfacing

* Add News entry
2017-09-07 13:53:13 -07:00
Elena Oat 397c467c49 bpo-31330: Clarify that RawTextHelpFormatter collapses repeated newlines. (#3272)
Also provide a solution if the user wants to keep multiple blank lines.
2017-09-07 16:06:45 -04:00
Steve Dower 05f01d8525 bpo-30389 Adds detection of VS 2017 to distutils._msvccompiler (#1632) 2017-09-07 11:49:23 -07:00
Benjamin Peterson a853a8ba78 bpo-31373: fix undefined floating-point demotions (#3396) 2017-09-07 11:13:59 -07:00
Benjamin Peterson c988ae01fe remove current_filename optimization from marshal (#3423) (closes bpo-31384) 2017-09-07 10:49:12 -07:00
Antoine Pitrou a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00