Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit b5dc270

Browse files
Merge pull request #136 from pquentin/merge-from-master-2019-10-30
Merge from master (October 30th, 2019)
2 parents f5ff1ac + f331ec4 commit b5dc270

25 files changed

+241
-366
lines changed

_travis/deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -exo pipefail
44

5-
python3 -m pip install --upgrade twine
5+
python3 -m pip install --upgrade twine wheel
66
python3 setup.py sdist bdist_wheel
77
python3 -m twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD --skip-existing

dev-requirements.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
mock==2.0.0
1+
mock==3.0.5
22
coverage~=4.5
3-
wheel==0.30.0
43
tornado==5.1.1
5-
PySocks==1.6.8
6-
pkginfo==1.4.2
4+
PySocks==1.7.1
5+
# https://github.com/Anorov/PySocks/issues/131
6+
win-inet-pton==1.1.0
7+
pytest==4.6.6
78
pytest-random-order==1.0.4;python_version>="3.5"
89
pytest-timeout==1.3.3
9-
pytest==4.6.4
1010
pytest-cov==2.7.1
1111
h11==0.8.0
1212
cryptography==2.6.1
13-
14-
# https://github.com/ionelmc/python-lazy-object-proxy/issues/30
15-
lazy-object-proxy==1.4.0
13+
flaky==3.6.1
1614

1715
# https://github.com/GoogleCloudPlatform/python-repo-tools/issues/23
1816
pylint<2.0;python_version<="2.7"
1917
gcp-devrel-py-tools
2018

2119
# optional dependencies, only intended for use with Python 3.5+
2220
trio==0.3.0; python_version >= "3.5"
21+
# https://github.com/mhammond/pywin32/issues/1439
22+
pywin32!=226; python_version >= "3.5" and os_name == 'nt'
2323
twisted[tls]==19.2.0; python_version >= "3.5" and os_name != 'nt'
2424
twisted[tls,windows_platform]==19.2.0; python_version >= "3.5" and os_name == 'nt'

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ urllib3 can be installed with `pip <https://pip.pypa.io>`_::
4343

4444
Alternatively, you can grab the latest source code from `GitHub <https://github.com/urllib3/urllib3>`_::
4545

46-
$ git clone git://github.com/shazow/urllib3.git
46+
$ git clone git://github.com/urllib3/urllib3.git
4747
$ python setup.py install
4848

4949
Usage

dummyserver/certs/client.csr

-23
This file was deleted.

dummyserver/certs/client.key

-15
This file was deleted.

dummyserver/certs/client.pem

-21
This file was deleted.

dummyserver/certs/intermediate.key

-15
This file was deleted.

dummyserver/certs/intermediate.pem

-18
This file was deleted.

dummyserver/server.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737
DEFAULT_CLIENT_CERTS = {
3838
"certfile": os.path.join(CERTS_PATH, "client_intermediate.pem"),
3939
"keyfile": os.path.join(CERTS_PATH, "client_intermediate.key"),
40-
"subject": dict(
41-
countryName=u"FI",
42-
stateOrProvinceName=u"dummy",
43-
organizationName=u"dummy",
44-
organizationalUnitName=u"dummy",
45-
commonName=u"SnakeOilClient",
46-
emailAddress=u"dummy@test.local",
47-
),
4840
}
4941
DEFAULT_CLIENT_NO_INTERMEDIATE_CERTS = {
5042
"certfile": os.path.join(CERTS_PATH, "client_no_intermediate.pem"),
@@ -86,7 +78,7 @@ def _has_ipv6(host):
8678
# has_ipv6 returns true if cPython was compiled with IPv6 support.
8779
# It does not tell us if the system has IPv6 support enabled. To
8880
# determine that we must bind to an IPv6 address.
89-
# https://github.com/shazow/urllib3/pull/611
81+
# https://github.com/urllib3/urllib3/pull/611
9082
# https://bugs.python.org/issue658327
9183
try:
9284
sock = socket.socket(socket.AF_INET6)
@@ -102,7 +94,7 @@ def _has_ipv6(host):
10294

10395
# Some systems may have IPv6 support but DNS may not be configured
10496
# properly. We can not count that localhost will resolve to ::1 on all
105-
# systems. See https://github.com/shazow/urllib3/pull/611 and
97+
# systems. See https://github.com/urllib3/urllib3/pull/611 and
10698
# https://bugs.python.org/issue18792
10799
HAS_IPV6_AND_DNS = _has_ipv6("localhost")
108100
HAS_IPV6 = _has_ipv6("::1")

dummyserver/testcase.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515

1616

1717
def consume_socket(sock, chunks=65536):
18-
while not sock.recv(chunks).endswith(b"\r\n\r\n"):
19-
pass
18+
consumed = bytearray()
19+
while True:
20+
b = sock.recv(chunks)
21+
consumed += b
22+
if b.endswith(b"\r\n\r\n"):
23+
break
24+
return consumed
2025

2126

2227
class SocketDummyServerTestCase(object):

noxfile.py

+95-93
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,95 @@
1-
import os
2-
import shutil
3-
4-
import nox
5-
6-
7-
def tests_impl(session, extras="socks,secure,brotli"):
8-
# Install deps and the package itself.
9-
session.install("-r", "dev-requirements.txt")
10-
session.install(".[{extras}]".format(extras=extras))
11-
12-
# Show the pip version.
13-
session.run("pip", "--version")
14-
# Print the Python version and bytesize.
15-
session.run("python", "--version")
16-
session.run("python", "-c", "import struct; print(struct.calcsize('P') * 8)")
17-
# Print OpenSSL information.
18-
session.run("python", "-m", "OpenSSL.debug")
19-
20-
session.run(
21-
"pytest",
22-
"-r",
23-
"a",
24-
"--cov=urllib3",
25-
*(session.posargs or ("test/",)),
26-
env={"PYTHONWARNINGS": "always::DeprecationWarning"}
27-
)
28-
session.run("coverage", "xml")
29-
session.run("python", "cleancov.py", "coverage.xml")
30-
31-
32-
@nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "pypy"])
33-
def test(session):
34-
tests_impl(session)
35-
36-
37-
@nox.session(python=["2", "3"])
38-
def google_brotli(session):
39-
# https://pypi.org/project/Brotli/ is the Google version of brotli, so
40-
# install it separately and don't install our brotli extra (which installs
41-
# brotlipy).
42-
session.install("brotli")
43-
tests_impl(session, extras="socks,secure")
44-
45-
46-
@nox.session(python="2.7")
47-
def app_engine(session):
48-
session.install("-r", "dev-requirements.txt")
49-
session.install(".")
50-
session.run(
51-
"coverage",
52-
"run",
53-
"--parallel-mode",
54-
"-m",
55-
"pytest",
56-
"-r",
57-
"sx",
58-
"test/appengine",
59-
*session.posargs
60-
)
61-
session.run("coverage", "combine")
62-
session.run("coverage", "report", "-m")
63-
64-
65-
@nox.session()
66-
def blacken(session):
67-
"""Run black code formater."""
68-
session.install("black")
69-
session.run("black", "src", "dummyserver", "test", "noxfile.py", "setup.py")
70-
71-
lint(session)
72-
73-
74-
@nox.session
75-
def lint(session):
76-
session.install("flake8", "black")
77-
session.run("flake8", "--version")
78-
session.run("black", "--version")
79-
session.run(
80-
"black", "--check", "src", "dummyserver", "test", "noxfile.py", "setup.py"
81-
)
82-
session.run("flake8", "setup.py", "docs", "dummyserver", "src", "test")
83-
84-
85-
@nox.session
86-
def docs(session):
87-
session.install("-r", "docs/requirements.txt")
88-
session.install(".[socks,secure,brotli]")
89-
90-
session.chdir("docs")
91-
if os.path.exists("_build"):
92-
shutil.rmtree("_build")
93-
session.run("sphinx-build", "-W", ".", "_build/html")
1+
import os
2+
import shutil
3+
4+
import nox
5+
6+
7+
def tests_impl(session, extras="socks,secure,brotli"):
8+
# Install deps and the package itself.
9+
session.install("-r", "dev-requirements.txt")
10+
session.install(".[{extras}]".format(extras=extras))
11+
12+
# Show the pip version.
13+
session.run("pip", "--version")
14+
# Print the Python version and bytesize.
15+
session.run("python", "--version")
16+
session.run("python", "-c", "import struct; print(struct.calcsize('P') * 8)")
17+
# Print OpenSSL information.
18+
session.run("python", "-m", "OpenSSL.debug")
19+
20+
session.run(
21+
"pytest",
22+
"-r",
23+
"a",
24+
"--tb=native",
25+
"--cov=urllib3",
26+
"--no-success-flaky-report",
27+
*(session.posargs or ("test/",)),
28+
env={"PYTHONWARNINGS": "always::DeprecationWarning"}
29+
)
30+
session.run("coverage", "xml")
31+
session.run("python", "cleancov.py", "coverage.xml")
32+
33+
34+
@nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "pypy"])
35+
def test(session):
36+
tests_impl(session)
37+
38+
39+
@nox.session(python=["2", "3"])
40+
def google_brotli(session):
41+
# https://pypi.org/project/Brotli/ is the Google version of brotli, so
42+
# install it separately and don't install our brotli extra (which installs
43+
# brotlipy).
44+
session.install("brotli")
45+
tests_impl(session, extras="socks,secure")
46+
47+
48+
@nox.session(python="2.7")
49+
def app_engine(session):
50+
session.install("-r", "dev-requirements.txt")
51+
session.install(".")
52+
session.run(
53+
"coverage",
54+
"run",
55+
"--parallel-mode",
56+
"-m",
57+
"pytest",
58+
"-r",
59+
"sx",
60+
"test/appengine",
61+
*session.posargs
62+
)
63+
session.run("coverage", "combine")
64+
session.run("coverage", "report", "-m")
65+
66+
67+
@nox.session()
68+
def blacken(session):
69+
"""Run black code formater."""
70+
session.install("black")
71+
session.run("black", "src", "dummyserver", "test", "noxfile.py", "setup.py")
72+
73+
lint(session)
74+
75+
76+
@nox.session
77+
def lint(session):
78+
session.install("flake8", "black")
79+
session.run("flake8", "--version")
80+
session.run("black", "--version")
81+
session.run(
82+
"black", "--check", "src", "dummyserver", "test", "noxfile.py", "setup.py"
83+
)
84+
session.run("flake8", "setup.py", "docs", "dummyserver", "src", "test")
85+
86+
87+
@nox.session
88+
def docs(session):
89+
session.install("-r", "docs/requirements.txt")
90+
session.install(".[socks,secure,brotli]")
91+
92+
session.chdir("docs")
93+
if os.path.exists("_build"):
94+
shutil.rmtree("_build")
95+
session.run("sphinx-build", "-W", ".", "_build/html")

src/urllib3/_async/connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ async def _wrap_socket(self, sock, ssl_context, fingerprint, assert_hostname):
402402
"back to check for a `commonName` for now. This "
403403
"feature is being removed by major browsers and "
404404
"deprecated by RFC 2818. (See "
405-
"https://github.com/shazow/urllib3/issues/497 for "
405+
"https://github.com/urllib3/urllib3/issues/497 for "
406406
"details.)".format(self._host)
407407
),
408408
SubjectAltNameWarning,

0 commit comments

Comments
 (0)