]> granicus.if.org Git - python/log
python
7 years agobpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined...
Oren Milman [Sun, 17 Sep 2017 10:45:38 +0000 (13:45 +0300)]
bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (#3615)

7 years agobpo-31493: Fix code context update and font update timers. (#3622)
Terry Jan Reedy [Sun, 17 Sep 2017 04:56:56 +0000 (00:56 -0400)]
bpo-31493: Fix code context update and font update timers. (#3622)

Canceling timers prevents a warning message when test_idle completes.
(This is the minimum fix needed before upcoming releases.)

7 years agoImprove f-strings documentation (GH-3604)
Mariatta [Sat, 16 Sep 2017 18:46:43 +0000 (11:46 -0700)]
Improve f-strings documentation (GH-3604)

Provide additional examples of using format specifiers in f-strings
Added examples for using integer and date format specifiers.

7 years agobpo-31458: Clarify that Changelog is built from Misc/NEWS.d directory (GH-3617)
Mariatta [Sat, 16 Sep 2017 17:43:30 +0000 (10:43 -0700)]
bpo-31458: Clarify that Changelog is built from Misc/NEWS.d directory (GH-3617)

7 years agobpo-31488: IDLE - update former extensions when options change. (#3612)
Terry Jan Reedy [Sat, 16 Sep 2017 05:42:28 +0000 (01:42 -0400)]
bpo-31488: IDLE - update former extensions when options change. (#3612)

When apply changes, call .reload on each class with non-key options.
Change ParenMatch so that updates affect current instances.

7 years agobpo-28411: Support other mappings in PyInterpreterState.modules. (#3593)
Eric Snow [Fri, 15 Sep 2017 22:35:20 +0000 (16:35 -0600)]
bpo-28411: Support other mappings in PyInterpreterState.modules. (#3593)

The concrete PyDict_* API is used to interact with PyInterpreterState.modules in a number of places. This isn't compatible with all dict subclasses, nor with other Mapping implementations. This patch switches the concrete API usage to the corresponding abstract API calls.

We also add a PyImport_GetModule() function (and some other helpers) to reduce a bunch of code duplication.

7 years agobpo-31431: SSLContext.check_hostname auto-sets CERT_REQUIRED (#3531)
Christian Heimes [Fri, 15 Sep 2017 18:29:57 +0000 (20:29 +0200)]
bpo-31431: SSLContext.check_hostname auto-sets CERT_REQUIRED (#3531)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)
Christian Heimes [Fri, 15 Sep 2017 18:27:30 +0000 (20:27 +0200)]
bpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)

Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and
PROTOCOL_TLS_SERVER.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31386: Custom wrap_bio and wrap_socket type (#3426)
Christian Heimes [Fri, 15 Sep 2017 18:26:05 +0000 (20:26 +0200)]
bpo-31386: Custom wrap_bio and wrap_socket type (#3426)

SSLSocket.wrap_bio() and SSLSocket.wrap_socket() hard-code SSLObject and
SSLSocket as return types. In the light of future deprecation of
ssl.wrap_socket() module function and direct instantiation of SSLSocket,
it is desirable to make the return type of SSLSocket.wrap_bio() and
SSLSocket.wrap_socket() customizable.

Signed-off-by: Christian Heimes <christian@python.org>
7 years ago bpo-314777: IDLE - improve rstrip entry in doc (#3602)
Terry Jan Reedy [Fri, 15 Sep 2017 17:05:28 +0000 (13:05 -0400)]
 bpo-314777: IDLE - improve rstrip entry in doc (#3602)

'Strip trailing whitespace' is not limited to spaces.  Wording caters to beginners who
do know know the meaning of 'whitespace'.  Multiline string literals are not skipped.

* News blurb.

7 years agoFix description in Python 3.7 What's New (#3603)
Paul Romano [Fri, 15 Sep 2017 17:00:57 +0000 (12:00 -0500)]
Fix description in Python 3.7 What's New (#3603)

7 years agobpo-29916: Include PyGetSetDef in C API extension documentation. (#831)
Michael Seifert [Fri, 15 Sep 2017 16:25:27 +0000 (18:25 +0200)]
bpo-29916: Include PyGetSetDef in C API extension documentation. (#831)

7 years agobpo-31234: test_multiprocessing: wait 30 seconds (#3599)
Victor Stinner [Fri, 15 Sep 2017 13:55:31 +0000 (06:55 -0700)]
bpo-31234: test_multiprocessing: wait 30 seconds (#3599)

Give 30 seconds to join_process(), instead of 5 or 10 seconds, to
wait until the process completes.

7 years agobpo-31234: Join timers in test_threading (#3598)
Victor Stinner [Fri, 15 Sep 2017 12:37:42 +0000 (05:37 -0700)]
bpo-31234: Join timers in test_threading (#3598)

Call the .join() method of threading.Timer timers to prevent the
"threading_cleanup() failed to cleanup 1 threads" warning.

7 years agobpo-31464: asdl_c.py no longer emits trailing spaces in Python-ast.h. (#3568)
Serhiy Storchaka [Fri, 15 Sep 2017 03:28:22 +0000 (06:28 +0300)]
bpo-31464: asdl_c.py no longer emits trailing spaces in Python-ast.h. (#3568)

7 years agobpo-31338 (#3374)
Barry Warsaw [Fri, 15 Sep 2017 01:13:16 +0000 (18:13 -0700)]
bpo-31338 (#3374)

* Add Py_UNREACHABLE() as an alias to abort().
* Use Py_UNREACHABLE() instead of assert(0)
* Convert more unreachable code to use Py_UNREACHABLE()
* Document Py_UNREACHABLE() and a few other macros.

7 years agobpo-31480: IDLE - fix tests to pass with zzdummy extension disabled. (#3590)
Terry Jan Reedy [Thu, 14 Sep 2017 22:51:51 +0000 (18:51 -0400)]
bpo-31480: IDLE - fix tests to pass with zzdummy extension disabled. (#3590)

Enabled by default was a temporary expedient.  The fix is to add a user override to enable.

7 years agobpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)
Feanil Patel [Thu, 14 Sep 2017 21:54:09 +0000 (17:54 -0400)]
bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)

New -n flag allow overriding localhost with custom value,
for example to run from containers.

7 years agobpo-30860: Fix deadcode in obmalloc.c (#3499)
Victor Stinner [Thu, 14 Sep 2017 21:48:37 +0000 (14:48 -0700)]
bpo-30860: Fix deadcode in obmalloc.c (#3499)

Fix Coverity CID 1417587: _PyMem_Initialize() contains code which is
never executed.

Replace the runtime check with a build assertion.

7 years agobpo-31234: Add support.join_thread() helper (#3587)
Victor Stinner [Thu, 14 Sep 2017 21:40:56 +0000 (14:40 -0700)]
bpo-31234: Add support.join_thread() helper (#3587)

join_thread() joins a thread but raises an AssertionError if the
thread is still alive after timeout seconds.

7 years agobpo-31234: Join threads in test_queue (#3586)
Victor Stinner [Thu, 14 Sep 2017 21:04:56 +0000 (14:04 -0700)]
bpo-31234: Join threads in test_queue (#3586)

Call thread.join() to prevent the "dangling thread" warning.

7 years agobpo-31234: Add test.support.wait_threads_exit() (#3578)
Victor Stinner [Thu, 14 Sep 2017 20:07:24 +0000 (13:07 -0700)]
bpo-31234: Add test.support.wait_threads_exit() (#3578)

Use _thread.count() to wait until threads exit. The new context
manager prevents the "dangling thread" warning.

7 years agobpo-31234: Join threads in test_threading (#3579)
Victor Stinner [Thu, 14 Sep 2017 20:05:21 +0000 (13:05 -0700)]
bpo-31234: Join threads in test_threading (#3579)

Call thread.join() to prevent the "dangling thread" warning.

7 years agobpo-31455: Fix an assertion failure in ElementTree.XMLParser(). (#3545)
scoder [Thu, 14 Sep 2017 20:00:03 +0000 (22:00 +0200)]
bpo-31455: Fix an assertion failure in ElementTree.XMLParser(). (#3545)

* Avoid calling "PyObject_GetAttrString()" (and potentially executing user code) with a live exception set.

* Ignore only AttributeError on attribute lookups in ElementTree.XMLParser() and propagate all other exceptions.

7 years agobpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has...
Oren Milman [Thu, 14 Sep 2017 19:30:28 +0000 (22:30 +0300)]
bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (#3580)

7 years agobpo-28556: typing.get_type_hints: better globalns for classes and modules (#3582)
Łukasz Langa [Thu, 14 Sep 2017 18:33:00 +0000 (14:33 -0400)]
bpo-28556: typing.get_type_hints: better globalns for classes and modules (#3582)

This makes the default behavior (without specifying `globalns` manually) more
predictable for users, finds the right globalns automatically.

Implementation for classes assumes has a `__module__` attribute and that module
is present in `sys.modules`.  It does this recursively for all bases in the
MRO.  For modules, the implementation just uses their `__dict__` directly.

This is backwards compatible, will just raise fewer exceptions in naive user
code.

Originally implemented and reviewed at https://github.com/python/typing/pull/470.

7 years agobpo-28411: Isolate PyInterpreterState.modules (#3575)
Eric Snow [Thu, 14 Sep 2017 18:18:12 +0000 (12:18 -0600)]
bpo-28411: Isolate PyInterpreterState.modules (#3575)

A bunch of code currently uses PyInterpreterState.modules directly instead of PyImport_GetModuleDict(). This complicates efforts to make changes relative to sys.modules. This patch switches to using PyImport_GetModuleDict() uniformly. Also, a number of related uses of sys.modules are updated for uniformity for the same reason.

Note that this code was already reviewed and merged as part of #1638. I reverted that and am now splitting it up into more focused parts.

7 years agobpo-31234: Join threads in test_hashlib (#3573)
Victor Stinner [Thu, 14 Sep 2017 15:43:22 +0000 (08:43 -0700)]
bpo-31234: Join threads in test_hashlib (#3573)

* bpo-31234: Join threads in test_hashlib

Use thread.join() to wait until the parallel hash tasks complete
rather than using events. Calling thread.join() prevent "dangling
thread" warnings.

* test_hashlib: minor PEP 8 coding style fixes

7 years agobpo-31234: Join threads in tests (#3572)
Victor Stinner [Thu, 14 Sep 2017 15:43:04 +0000 (08:43 -0700)]
bpo-31234: Join threads in tests (#3572)

Call thread.join() on threads to prevent the "dangling threads"
warning.

7 years agobpo-31457: Allow for nested LoggerAdapter objects (#3551)
Łukasz Langa [Thu, 14 Sep 2017 15:34:47 +0000 (11:34 -0400)]
bpo-31457: Allow for nested LoggerAdapter objects (#3551)

Some of the proxied methods use internal Logger state which isn't proxied,
causing failures if an adapter is applied to another adapter.

This commit fixes the issue, adds a new test for the use case.

7 years ago_ssl_: Fix compiler warning (#3559)
Victor Stinner [Thu, 14 Sep 2017 08:10:30 +0000 (01:10 -0700)]
_ssl_: Fix compiler warning (#3559)

Cast Py_buffer.len (Py_ssize_t, signed) to size_t (unsigned) to
prevent the following warning:

Modules/_ssl.c:3089:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]

7 years agobpo-30860: Fix a refleak. (#3567)
Eric Snow [Thu, 14 Sep 2017 07:35:58 +0000 (00:35 -0700)]
bpo-30860: Fix a refleak. (#3567)

Resolves bpo-31420.

(This was accidentally reverted when in #3565.)

7 years agobpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)
Eric Snow [Thu, 14 Sep 2017 06:46:04 +0000 (23:46 -0700)]
bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)

PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.

7 years agobpo-31462: Remove trailing whitespaces. (#3564)
Serhiy Storchaka [Thu, 14 Sep 2017 06:38:36 +0000 (09:38 +0300)]
bpo-31462: Remove trailing whitespaces. (#3564)

7 years agoImprove code examples in hashlib cookie signing (GH-3562)
sww [Thu, 14 Sep 2017 06:24:36 +0000 (23:24 -0700)]
Improve code examples in hashlib cookie signing (GH-3562)

The `blake2b` function does not take the `data` keyword argument.
The hex digest returned by sign was a string, whereas compare_digest expects bytes-like objects.
Typo fix: compare_digesty -> compare_digest

7 years agobpo-30246: fix several error messages which only mention bytes in struct (#1421)
Xiang Zhang [Thu, 14 Sep 2017 02:33:26 +0000 (10:33 +0800)]
bpo-30246: fix several error messages which only mention bytes in struct (#1421)

7 years agobpo-31458: Update Misc/NEWS link in What's New page (GH-3555)
Mariatta [Wed, 13 Sep 2017 23:47:33 +0000 (16:47 -0700)]
bpo-31458: Update Misc/NEWS link in What's New page (GH-3555)

Update the link from Misc/NEWS to Misc/NEWS.d

7 years agobpo-31234: Try to fix lock_tests warning (#3557)
Victor Stinner [Wed, 13 Sep 2017 23:41:08 +0000 (16:41 -0700)]
bpo-31234: Try to fix lock_tests warning (#3557)

Try to fix the "Warning -- threading_cleanup() failed to cleanup 1
threads" warning in test.lock_tests: wait a little bit longer to give
time to the threads to complete.

Warning seen on test_thread and test_importlib.

7 years agobpo-28556: Minor updates to typing module (#3550)
Ivan Levkivskyi [Wed, 13 Sep 2017 23:25:15 +0000 (01:25 +0200)]
bpo-28556: Minor updates to typing module (#3550)

* Copy changes to typing from upstream repo
* Add NEWS entry

7 years agobpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exceptio...
Oren Milman [Wed, 13 Sep 2017 22:30:05 +0000 (01:30 +0300)]
bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__ attribute. (#3539)

7 years agobpo-31234: threading_cleanup() now warns immediately (#3138)
Victor Stinner [Wed, 13 Sep 2017 20:42:00 +0000 (13:42 -0700)]
bpo-31234: threading_cleanup() now warns immediately (#3138)

support.threading_cleanup() waits for 1 second before emitting a
warning if there are threads running in the background. With this
change, it now emits the warning immediately, to be able to catch
bugs more easily.

7 years agoUpdate subprocess.communicate() docstring.
Joel Schaerer [Wed, 13 Sep 2017 19:11:20 +0000 (21:11 +0200)]
Update subprocess.communicate() docstring.

Explicitly state that communicate() closes stdin after writing input to it.

7 years agobpo-31234, socket.create_connection(): Fix ref cycle (#3546)
Victor Stinner [Wed, 13 Sep 2017 17:10:10 +0000 (10:10 -0700)]
bpo-31234, socket.create_connection(): Fix ref cycle (#3546)

7 years agobpo-31234: Fix dangling thread in test_ftplib (#3544)
Victor Stinner [Wed, 13 Sep 2017 13:43:58 +0000 (06:43 -0700)]
bpo-31234: Fix dangling thread in test_ftplib (#3544)

Clear also self.server_thread attribute in TestTimeouts.tearDown().

7 years agobpo-31448, test_poplib: Fix ResourceWarning (#3542)
Victor Stinner [Wed, 13 Sep 2017 12:53:10 +0000 (05:53 -0700)]
bpo-31448, test_poplib: Fix ResourceWarning (#3542)

Call POP3.close(), don't close close directly the sock attribute.

7 years agoTravis CI: run coverage test using --fail-env-changed (#3541)
Victor Stinner [Wed, 13 Sep 2017 12:17:27 +0000 (05:17 -0700)]
Travis CI: run coverage test using --fail-env-changed (#3541)

7 years agobpo-31234: Fix dangling thread in test_ftp/poplib (#3540)
Victor Stinner [Wed, 13 Sep 2017 10:58:25 +0000 (03:58 -0700)]
bpo-31234: Fix dangling thread in test_ftp/poplib (#3540)

Explicitly clear the server attribute in test_ftplib and test_poplib
to prevent dangling thread.

7 years agobpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)
Victor Stinner [Wed, 13 Sep 2017 08:47:22 +0000 (01:47 -0700)]
bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)

socketserver.ThreadingMixIn now keeps a list of non-daemonic threads
to wait until all these threads complete in server_close().

Reenable test_logging skipped tests.

Fix SocketHandlerTest.tearDown(): close the socket handler before
stopping the server, so the server can join threads.

7 years agobpo-30830: logging.config.listen() calls server_close() (#3524)
Victor Stinner [Wed, 13 Sep 2017 08:44:08 +0000 (01:44 -0700)]
bpo-30830: logging.config.listen() calls server_close() (#3524)

The ConfigSocketReceiver.serve_until_stopped() method from
logging.config.listen() now calls server_close() (of
socketserver.ThreadingTCPServer) rather than closing manually the
socket.

While this change has no effect yet, it will help to prevent dangling
threads once ThreadingTCPServer.server_close() will join spawned
threads (bpo-31233).

7 years agoMention enum as an ex (#2982)
Louie Lu [Wed, 13 Sep 2017 04:44:14 +0000 (12:44 +0800)]
Mention enum as an ex (#2982)

7 years agobpo-31394: Make tokenize.rst PEP 8-compliant (GH-3526)
Mariatta [Wed, 13 Sep 2017 04:00:00 +0000 (21:00 -0700)]
bpo-31394: Make tokenize.rst PEP 8-compliant (GH-3526)

The last commit contained lines longer than 80 characters.

7 years agobpo-31394: Clarify documentation about token type attribute (GH-3469)
Aivar Annamaa [Wed, 13 Sep 2017 03:24:03 +0000 (06:24 +0300)]
bpo-31394: Clarify documentation about token type attribute (GH-3469)

Make it clear that Ellipsis tokens also have type attribute set to token.OP.

7 years agobpo-31249: Fix test_concurrent_futures dangling thread (#3521)
Victor Stinner [Wed, 13 Sep 2017 00:05:53 +0000 (17:05 -0700)]
bpo-31249: Fix test_concurrent_futures dangling thread (#3521)

ProcessPoolShutdownTest.test_del_shutdown() now closes the call queue
and joins its thread, to prevent leaking a dangling thread.

7 years agobpo-31234: Enhance test_thread.test_forkinthread() (#3516)
Victor Stinner [Tue, 12 Sep 2017 17:49:22 +0000 (10:49 -0700)]
bpo-31234: Enhance test_thread.test_forkinthread() (#3516)

* test_thread.test_forkinthread() now waits until the thread completes.
* Check the status in the test method, not in the thread function
* Don't ignore RuntimeError anymore: since the commit
  346cbd351ee0dd3ab9cb9f0e4cb625556707877e (bpo-16500,
  os.register_at_fork(), os.fork() cannot fail anymore with
  RuntimeError.
* Replace 0.01 literal with a new POLL_SLEEP constant
* test_forkinthread(): test if os.fork() exists rather than testing
  the platform.

7 years agobpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element...
Oren Milman [Tue, 12 Sep 2017 14:39:15 +0000 (17:39 +0300)]
bpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element.__deepcopy__() isn't a dictionary. (#3512)

7 years agobpo-31421: Document how IDLE runs tkinter programs. (#3513)
Terry Jan Reedy [Tue, 12 Sep 2017 13:05:16 +0000 (09:05 -0400)]
bpo-31421: Document how IDLE runs tkinter programs. (#3513)

IDLE calls tcl/tk update in the background in order to make live
interaction and experimentatin with tkinter applications much easier.

7 years agobpo-27099: Finish updating IDLE doc and help text. (#3510)
Terry Jan Reedy [Tue, 12 Sep 2017 11:45:15 +0000 (07:45 -0400)]
bpo-27099: Finish updating IDLE doc and help text. (#3510)

As needed for the conversion of extensions to features.

7 years agobpo-30860: Move windows.h include out of internal/*.h. (#3458)
Eric Snow [Tue, 12 Sep 2017 01:30:43 +0000 (18:30 -0700)]
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.

7 years agobpo-30860: Fix a refleak. (#3506)
Eric Snow [Tue, 12 Sep 2017 00:59:22 +0000 (17:59 -0700)]
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.

7 years agobpo-30860: Always provide serialno. (#3507)
Eric Snow [Tue, 12 Sep 2017 00:02:24 +0000 (17:02 -0700)]
bpo-30860: Always provide serialno. (#3507)

This fixes bpo-31407.

7 years agobpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defau...
Oren Milman [Mon, 11 Sep 2017 21:18:09 +0000 (00:18 +0300)]
bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (#3496)

Patch by Oren Milman.

7 years agobpo-30928: Update idlelib/NEWS.txt to 2017-09-11. (#3503)
Terry Jan Reedy [Mon, 11 Sep 2017 20:43:26 +0000 (16:43 -0400)]
bpo-30928: Update idlelib/NEWS.txt to 2017-09-11. (#3503)

7 years agobpo-31414: IDLE -- fix tk entry box tests by deleting first. (#3501)
Terry Jan Reedy [Mon, 11 Sep 2017 20:02:33 +0000 (16:02 -0400)]
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.

7 years agobpo-30860: Add Include/internal/ in "make tags" (#3498)
Victor Stinner [Mon, 11 Sep 2017 16:34:36 +0000 (09:34 -0700)]
bpo-30860: Add Include/internal/ in "make tags" (#3498)

7 years agotest_ssl: Implement timeout in ssl_io_loop() (#3500)
Victor Stinner [Mon, 11 Sep 2017 16:34:24 +0000 (09:34 -0700)]
test_ssl: Implement timeout in ssl_io_loop() (#3500)

The timeout parameter was not used.

7 years agoRemove a null statement that was necessary for --without-threads (#3478)
Zackery Spytz [Mon, 11 Sep 2017 10:37:10 +0000 (04:37 -0600)]
Remove a null statement that was necessary for --without-threads (#3478)

7 years agobpo-31373: remove overly strict float range checks (#3486)
Benjamin Peterson [Mon, 11 Sep 2017 06:50:46 +0000 (23:50 -0700)]
bpo-31373: remove overly strict float range checks (#3486)

This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 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.

7 years agobpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dicti...
Oren Milman [Mon, 11 Sep 2017 06:28:39 +0000 (09:28 +0300)]
bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (#3485)

7 years agobpo-30781: IDLE: Fix help button on configdialog (#3238)
Cheryl Sabella [Mon, 11 Sep 2017 02:41:10 +0000 (22:41 -0400)]
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.

7 years agobpo-27099: IDLE - Convert built-in extensions to regular features (#2494)
wohlganger [Sun, 10 Sep 2017 21:19:47 +0000 (16:19 -0500)]
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.

7 years agoSimplify run_tests.py (#3482)
Antoine Pitrou [Sun, 10 Sep 2017 18:32:13 +0000 (20:32 +0200)]
Simplify run_tests.py (#3482)

7 years agobpo-28638: Optimize namedtuple() creation time by minimizing use of exec() (#3454)
Raymond Hettinger [Sun, 10 Sep 2017 17:23:36 +0000 (10:23 -0700)]
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

7 years agobpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)
Stefan Krah [Sun, 10 Sep 2017 16:08:04 +0000 (18:08 +0200)]
bpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)

7 years agoImprove IncrementalEncoder documentation (GH-2746)
Zhiming Wang [Sun, 10 Sep 2017 06:09:55 +0000 (02:09 -0400)]
Improve IncrementalEncoder documentation (GH-2746)

getstate and setstate are instance methods, same as encode and reset.

7 years agobpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474)
Stefan Krah [Sat, 9 Sep 2017 17:26:22 +0000 (19:26 +0200)]
bpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474)

7 years agoMake `json.dumps()` example to be PEP-8 compliant. (GH-3472)
Sergey Fedoseev [Sat, 9 Sep 2017 16:39:36 +0000 (21:39 +0500)]
Make `json.dumps()` example to be PEP-8 compliant. (GH-3472)

7 years agobpo-31392: Update SSL build for 1.1.0 (#3448)
Steve Dower [Sat, 9 Sep 2017 13:13:06 +0000 (06:13 -0700)]
bpo-31392: Update SSL build for 1.1.0 (#3448)

7 years agobpo-29639: change test.support.HOST to "localhost"
Gregory P. Smith [Sat, 9 Sep 2017 07:30:15 +0000 (00:30 -0700)]
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.

7 years agobpo-26669: Fix nan arg value error in pytime.c (#3085)
Han Lee [Fri, 8 Sep 2017 23:05:05 +0000 (08:05 +0900)]
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

7 years agobpo-31400: Improve SSL error handling on Windows (#3463)
Steve Dower [Fri, 8 Sep 2017 22:16:15 +0000 (15:16 -0700)]
bpo-31400: Improve SSL error handling on Windows (#3463)

* bpo-31392: Improve SSL error handling on Windows

* Remove unnecessary Windows mention in NEWS

7 years agobpo-28182: restore backwards compatibility (#3464)
Christian Heimes [Fri, 8 Sep 2017 21:47:58 +0000 (14:47 -0700)]
bpo-28182: restore backwards compatibility (#3464)

b3ad0e5 broke backwards compatibility with OpenSSL < 1.0.2.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agodelete dead locale initialization code for windows (#3461)
Benjamin Peterson [Fri, 8 Sep 2017 21:30:07 +0000 (14:30 -0700)]
delete dead locale initialization code for windows (#3461)

7 years agobpo-31354: Let configure --with-lto work on all builds
octaviansoldea [Fri, 8 Sep 2017 19:14:33 +0000 (12:14 -0700)]
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.

7 years agobpo-28182: Expose OpenSSL verification results (#3412)
Christian Heimes [Fri, 8 Sep 2017 19:00:19 +0000 (12:00 -0700)]
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>
7 years agoFixes reference leak (#3457)
Steve Dower [Fri, 8 Sep 2017 18:35:38 +0000 (11:35 -0700)]
Fixes reference leak (#3457)

7 years agoreplace custom table with pyctype (#3456)
Benjamin Peterson [Fri, 8 Sep 2017 17:35:49 +0000 (10:35 -0700)]
replace custom table with pyctype (#3456)

7 years agobpo-31393: Fix the use of PyUnicode_READY(). (#3451)
Serhiy Storchaka [Fri, 8 Sep 2017 06:58:51 +0000 (09:58 +0300)]
bpo-31393: Fix the use of PyUnicode_READY(). (#3451)

7 years agoShow example of itemgetter() applied to a dictionary (#3431)
Raymond Hettinger [Fri, 8 Sep 2017 06:53:07 +0000 (23:53 -0700)]
Show example of itemgetter() applied to a dictionary (#3431)

7 years agoupdate all_name_chars comment after 9020ac7cce97dddad51b285fffc31fe4ddf60898 (#3452)
Benjamin Peterson [Fri, 8 Sep 2017 06:35:53 +0000 (23:35 -0700)]
update all_name_chars comment after 9020ac7cce97dddad51b285fffc31fe4ddf60898 (#3452)

7 years agobpo-30860: Consolidate stateful runtime globals. (#3397)
Eric Snow [Fri, 8 Sep 2017 05:51:28 +0000 (23:51 -0600)]
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).

7 years agoUpdates PCBuild/readme.txt (#3418)
Steve Dower [Fri, 8 Sep 2017 03:10:29 +0000 (20:10 -0700)]
Updates PCBuild/readme.txt (#3418)

7 years agobpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (#1363)
Christian Heimes [Fri, 8 Sep 2017 01:07:00 +0000 (18:07 -0700)]
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>
7 years agooptimize all_name_chars (#3442)
Benjamin Peterson [Fri, 8 Sep 2017 01:06:23 +0000 (18:06 -0700)]
optimize all_name_chars (#3442)

Remove redundant PyUnicode_Check call. Use a static table for checking chars.

7 years agobpo-31036: Allow sphinx and blurb to be found automatically (#3440)
Ned Deily [Fri, 8 Sep 2017 00:17:53 +0000 (17:17 -0700)]
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.

7 years agobpo-31344: Per-frame control of trace events (GH-3417)
Nick Coghlan [Fri, 8 Sep 2017 00:14:16 +0000 (10:14 +1000)]
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.

7 years agobpo-22635: Update the getstatusoutput docstring. (#3435)
Gregory P. Smith [Thu, 7 Sep 2017 23:11:02 +0000 (16:11 -0700)]
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.

7 years agobpo-27340: Use memoryview in SSLSocket.sendall() (#3384)
Christian Heimes [Thu, 7 Sep 2017 21:18:21 +0000 (14:18 -0700)]
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>
7 years agobpo-28958: Improve SSLContext error reporting. (#3414)
Christian Heimes [Thu, 7 Sep 2017 21:14:00 +0000 (14:14 -0700)]
bpo-28958: Improve SSLContext error reporting. (#3414)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31270: Modification of Pr 3200 (#3427)
Raymond Hettinger [Thu, 7 Sep 2017 21:01:44 +0000 (14:01 -0700)]
bpo-31270: Modification of Pr 3200 (#3427)

* bpo-31270: Simplify documentation of itertools.zip_longest

* Use repeat(). Track num_active.

7 years agoUpdate copyright PSF to 2001-2017 (#3421)
Christian Heimes [Thu, 7 Sep 2017 20:59:13 +0000 (13:59 -0700)]
Update copyright PSF to 2001-2017 (#3421)

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