Vlad Starostin [Mon, 21 May 2018 08:13:45 +0000 (11:13 +0300)]
bpo-33263: Fix FD leak in _SelectorSocketTransport (GH-6450)
* 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.
Signed-off-by: Christian Heimes <christian@python.org>
<!--
Thanks for your contribution!
Please read this comment in its entirety. It's quite important.
# Pull Request title
It should be in the following format:
```
bpo-NNNN: Summary of the changes made
```
Where: bpo-NNNN refers to the issue number in the https://bugs.python.org.
Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.
# Backport Pull Request title
If this is a backport PR (PR made against branches other than `master`),
please ensure that the PR title is in the following format:
```
[X.Y] <title from the original PR> (GH-NNNN)
```
CtrlZvi [Sun, 20 May 2018 15:03:25 +0000 (08:03 -0700)]
bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
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.
Serhiy Storchaka [Sun, 20 May 2018 13:30:31 +0000 (16:30 +0300)]
bpo-33584: Fix several minor bugs in asyncio. (GH-7003)
Fix the following bugs in the C implementation:
* get_future_loop() silenced all exceptions raised when look up the get_loop
attribute, not just an AttributeError.
* enter_task() silenced all exceptions raised when look up the current task,
not just a KeyError.
* repr() was called for a borrowed link in enter_task() and task_step_impl().
* str() was used instead of repr() in formatting one error message (in
Python implementation too).
* There where few reference leaks in error cases.
CtrlZvi [Sun, 20 May 2018 10:21:10 +0000 (03:21 -0700)]
bpo-26819: Prevent proactor double read on resume (#6921)
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.
Eric V. Smith [Wed, 16 May 2018 09:14:53 +0000 (05:14 -0400)]
Reflow dataclasses comments (GH-6893)
To be more consistent with other code (and so people stop hassling me!), reflow the dataclasses comments to not use a single space indentation when continuing a paragraph of text.
Eitan Adler [Tue, 15 May 2018 03:55:41 +0000 (20:55 -0700)]
bpo-33483: more correctly handle finding the C compiler (GH-6780)
Instead of passing configure args such as --without-gcc or --with-icc,
instead prefer to rely on the native way of finding the compiler:
passing CC (or CPP or CXX depending).
This allows configure to find the correct compiler instead of having to
be explicitly told. It also more correctly builds on both macOS and
FreeBSD since the system compiler is used by default (cc)
The urllib.robotparser's __str__ representation now includes wildcard
entries and the "Crawl-delay" and "Request-rate" fields. Also removes extra
newlines that were being appended to the end of the string.
Eitan Adler [Mon, 14 May 2018 00:55:35 +0000 (17:55 -0700)]
bpo-33488: Satisfy markdownlint for the pull request template. (GH-6786)
./.github/PULL_REQUEST_TEMPLATE.md:8: MD031 Fenced code blocks should be
surrounded by blank lines
./.github/PULL_REQUEST_TEMPLATE.md:10: MD031 Fenced code blocks should
be surrounded by blank lines
./.github/PULL_REQUEST_TEMPLATE.md:19: MD031 Fenced code blocks should
be surrounded by blank lines
./.github/PULL_REQUEST_TEMPLATE.md:21: MD031 Fenced code blocks should
be surrounded by blank lines
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.
Miro Hrončok [Fri, 11 May 2018 05:40:43 +0000 (07:40 +0200)]
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
Pass os.environ's copy to new process created at test_posix:
test_specify_environment. Otherwise important variables such as
LD_LIBRARY_PATH are not set and the child process might not work at all
in an environment where such variables are required for Python to function.
bpo-33441: Make the sigset_t converter available in other modules. (GH-6720)
* Expose the sigset_t converter via private API _Py_Sigset_Converter().
* Use Argument Clinic for parsing sigset_t in signalmodule.c.
* Raise ValueError instead OverflowError for integers out of
the C long range.