Staging
v0.5.1
https://github.com/python/cpython
Revision 123f6c4914827c4ced65d032fab74de62db31cd6 authored by Miss Islington (bot) on 14 August 2019, 21:47:43 UTC, committed by GitHub on 14 August 2019, 21:47:43 UTC

FreeBSD implementation of poll(2) restricts the timeout argument to be
either zero, or positive, or equal to INFTIM (-1).

Unless otherwise overridden, socket timeout defaults to -1. This value
is then converted to milliseconds (-1000) and used as argument to the
poll syscall. poll returns EINVAL (22), and the connection fails.

This bug was discovered during the EINTR handling testing, and the
reproduction code can be found in
https://bugs.python.org/issue23618 (see connect_eintr.py,
attached). On GNU/Linux, the example runs as expected.

This change is trivial:
If the supplied timeout value is negative, truncate it to -1.
(cherry picked from commit 28146206578ebe1b84b48e6f255738a227058c04)

Co-authored-by: Artem Khramov <akhramov@pm.me>
1 parent 557802d
History
Tip revision: 123f6c4914827c4ced65d032fab74de62db31cd6 authored by Miss Islington (bot) on 14 August 2019, 21:47:43 UTC
bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
Tip revision: 123f6c4
File Mode Size
.azure-pipelines
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
m4
.gitattributes -rw-r--r-- 1.8 KB
.gitignore -rw-r--r-- 1.6 KB
.travis.yml -rw-r--r-- 8.5 KB
CODE_OF_CONDUCT.md -rw-r--r-- 630 bytes
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 65.4 KB
README.rst -rw-r--r-- 9.8 KB
aclocal.m4 -rw-r--r-- 13.1 KB
config.guess -rwxr-xr-x 43.1 KB
config.sub -rwxr-xr-x 35.4 KB
configure -rwxr-xr-x 491.9 KB
configure.ac -rw-r--r-- 162.3 KB
install-sh -rwxr-xr-x 15.0 KB
pyconfig.h.in -rw-r--r-- 44.1 KB
setup.py -rw-r--r-- 101.0 KB

README.rst

back to top