This is a simple grammatical fix correcting "...object whose `__self__` attributes is ..." to "...object whose `__self__` attribute is ...".
(cherry picked from commit 00818c8ffd657f9ec727e366bfffd9c2135fa5ab)
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 de6516264e793be991f692fdd892707afb9104a7)
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 29996a1c4e8bd6dde6adce2b44d11a0982a47a3a)
Victor Stinner [Fri, 1 Jun 2018 17:39:16 +0000 (19:39 +0200)]
bpo-31238: pydoc ServerThread.stop() now joins itself (GH-3151) (GH-7324)
ServerThread.stop() now joins itself to wait until
DocServer.serve_until_quit() completes and then explicitly sets
its docserver attribute to None to break a reference cycle.
Victor Stinner [Fri, 1 Jun 2018 14:24:43 +0000 (16:24 +0200)]
bpo-33540, socketserver: Add _block_on_close for tests (GH-7317)
* Add a private _block_on_close attribute to ForkingMixIn and
ThreadingMixIn classes of socketserver.
* Use _block_on_close=True in test_socketserver and test_logging
* 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.
Victor Stinner [Fri, 1 Jun 2018 11:47:24 +0000 (13:47 +0200)]
bpo-31009: Move fd_count() to test.support (#7308)
* Move fd_count() from test.libregrtest.refleak to test.support
* Fix support.fd_count() on Windows: Call CrtSetReportMode() to not
kill the process on invalid file descriptor if Python is compiled
in debug mode.
T. Wouters [Thu, 31 May 2018 10:20:46 +0000 (12:20 +0200)]
[3.6] bpo-32591: fix abort in _PyErr_WarnUnawaitedCoroutine during shutdown (GH-5337) (#6536)
When an unawaited coroutine is collected very late in shutdown --
like, during the final GC at the end of PyImport_Cleanup -- then it
was triggering an interpreter abort, because we'd try to look up the
"warnings" module and not only was it missing (we were prepared for
that), but the entire module system was missing (which we were not
prepared for).
I've tried to fix this at the source, by making the utility function
get_warnings_attr robust against this in general. Note that it already
has the convention that it can return NULL without setting an error,
which is how it signals that the attribute it was asked to fetch is
missing, and that all callers already check for NULL returns.
There's a similar check for being late in shutdown at the top of
warn_explicit, which might be unnecessary after this fix, but I'm not
sure so I'm going to leave it..
(cherry picked from commit dba976b8a28d6e5daa66ef31a6a7c694a9193f6a)
Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
* Add a space to ensurepip's --altinstall option
* Add periods to the arguments of ensurepip that didn't have it
This makes --help for all optional arguments consistent and also makes it
consistent with pip --help.
(cherry picked from commit e9537ad6a128924dd610bea2268065500c174181)
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.
bpo-31647: Fix write_eof() after close() for SelectorSocketTransport (GH-7149) (#7154)
Fixed bug where calling write_eof() on a _SelectorSocketTransport after
it's already closed raises AttributeError.
(cherry picked from commit 23f587e395e41bd5e116312b036183f42bc4159b)
bpo-33655: Also ignore test_posix_fallocate failures on BSD platforms (GH-7134)
The failure may be due to the use oF ZFS, a case we already ignore
for Solaris-based systems where ZFS is frequently used.
(cherry picked from commit 09c4a7dee2eb39b515e5f499f184257cdbe9cb42)
CtrlZvi [Fri, 25 May 2018 08:03:25 +0000 (01:03 -0700)]
[3.6] bpo-26819: Prevent proactor double read on resume (GH-6921) (#7110)
The proactor event loop has a race condition when reading with
pausing/resuming. `resume_reading()` unconditionally schedules the read
function to read from the current future. If `resume_reading()` was
called before the previously scheduled done callback fires, this results
in two attempts to get the data from the most recent read and an
assertion failure. This commit tracks whether or not `resume_reading`
needs to reschedule the callback to restart the loop, preventing a
second attempt to read the data..
(cherry picked from commit 4151061855b571bf8a7579daa7875b8e243057b9)
bpo-33629: Prevent coredump in test_importlib (GH-7090)
bpo-32374, bpo-33629: Use support.SuppressCrashReport() in
test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent
leaking a core dump file.
(cherry picked from commit 483000e164ec68717d335767b223ae31b4b720cf)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
Serhiy Storchaka [Thu, 24 May 2018 13:05:38 +0000 (16:05 +0300)]
[3.6] bpo-33622: Fix issues with handling errors in the GC. (GH-7078) (GH-7095)
* Fixed a leak when the GC fails to add an object with __del__ into
the gc.garbage list.
* PyGC_Collect() can now be called when an exception is set and
preserves it.
* Fixed an undefined behavior with comparing a dead pointer with NULL.
(cherry picked from commit 301e3cc8a5bc68c5347ab6ac6f83428000d31ab2)
Serhiy Storchaka [Mon, 21 May 2018 12:20:55 +0000 (15:20 +0300)]
[3.6] bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922) (GH-7014)
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match.
(cherry picked from commit c66c342cb42ab8a88884527ddfe3a5086bc06316)
Andrew Svetlov [Mon, 21 May 2018 10:09:49 +0000 (13:09 +0300)]
[3.6] bpo-33263: Fix FD leak in _SelectorSocketTransport (GH-6450) (#7025)
* bpo-33263 Fix FD leak in _SelectorSocketTransport. (GH-6450)
Under particular circumstances _SelectorSocketTransport can try to add a reader
even the transport is already being closed. This can lead to FD leak and
invalid stated of the following connections. Fixed the SelectorSocketTransport
to add the reader only if the trasport is still active..
(cherry picked from commit a84d0b361a26c05c6fadc6640591ec3feee5bfb5)
Docs: be less specific about python versions (GH-6985)
CPython 3.5 is old now, and we don't bump this version often,
so lets avoid using specific versions.
(cherry picked from commit 9572132ab3c2edddb8087a0112116da866373f79)
Serhiy Storchaka [Sun, 20 May 2018 14:33:55 +0000 (17:33 +0300)]
[3.6] bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (#7006)
* repr() was called for a borrowed link.
* str() was used instead of repr() in formatting one error message.
(cherry picked from commit 6655354afcd116c27486bb5ba1dfa50b369d8d85)
bpo-29706: Test that IDLE colors async/await as keywords. (GH-6846)
Added to the eye-verified htest, not to the unittests.
Also remove some stray leftover comments.
(cherry picked from commit 389a48ede92bf7965889d554d2cd17b50d6e3d86)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
The urllib.robotparser's __str__ representation now includes wildcard
entries and the "Crawl-delay" and "Request-rate" fields.
(cherry picked from commit c3fa1f2b93fa4bf96a8aadc74ee196384cefa31e)
Co-authored-by: Michael Lazar <lazar.michael22@gmail.com>
bpo-32601: Let test_expanduser use the same user if no others found. (GH-5246)
This happens in the NixOS build sandbox, for example, where the only
other user is nobody with home directory /.
(cherry picked from commit 5c0d462689e1a69537eaeba6ab94e3ff3524fc31)
bpo-28055: Fix unaligned accesses in siphash24(). (GH-6123)
The hash implementation casts the input pointer to uint64_t* and directly reads
from this, which may cause unaligned accesses. Use memcpy() instead so this code
will not crash with SIGBUS on sparc.