Skip to content

Commit 5542487

Browse files
authored
Merge branch 'master' into format_examples
2 parents 70fe3f7 + 41a3467 commit 5542487

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ python:
77
- pypy
88
- pypy3
99
- 2.7
10-
- 3.4
1110
- 3.5
1211
- 3.6
1312
- 3.7
14-
- 3.8-dev
13+
- 3.8
1514

1615
before_install:
1716
- pip install -U pip setuptools wheel

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ library.
112112
It has a test suite with 100.0% coverage for both statements and
113113
branches.
114114

115-
Currently it supports Python 3 (testing on 3.4-3.7), Python 2.7, and PyPy.
115+
Currently it supports Python 3 (testing on 3.5-3.8), Python 2.7, and PyPy.
116116
(Originally it had a Cython wrapper for `http-parser
117117
<https://github.com/nodejs/http-parser>`_ and a beautiful nested state
118118
machine implemented with ``yield from`` to postprocess the output. But

docs/source/basic-usage.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ And then we can send requests:
238238
client = MyHttpClient("httpbin.org", 443)
239239
240240
client.send(h11.Request(method="GET", target="/xml",
241-
headers=[("Host", "httpbin.org")]),
242-
h11.EndOfMessage())
241+
headers=[("Host", "httpbin.org")]))
242+
client.send(h11.EndOfMessage())
243243
244244
And read back the events:
245245

@@ -321,8 +321,8 @@ allowing us to send another :class:`Request`:
321321
client.conn.our_state, client.conn.their_state
322322
323323
client.send(h11.Request(method="GET", target="/get",
324-
headers=[("Host", "httpbin.org")]),
325-
h11.EndOfMessage())
324+
headers=[("Host", "httpbin.org")]))
325+
client.send(h11.EndOfMessage())
326326
client.next_event()
327327
328328
@@ -339,9 +339,9 @@ Here's some ideas of things you might try:
339339
340340
client.send(h11.Request(method="POST", target="/post",
341341
headers=[("Host", "httpbin.org"),
342-
("Content-Length", "10")]),
343-
h11.Data(data=b"1234567890"),
344-
h11.EndOfMessage())
342+
("Content-Length", "10")]))
343+
client.send(h11.Data(data=b"1234567890"))
344+
client.send(h11.EndOfMessage())
345345
346346
* Experiment with what happens if you try to violate the HTTP protocol
347347
by sending a :class:`Response` as a client, or sending two

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ whatever. But h11 makes it much easier to implement something like
4444
Vital statistics
4545
----------------
4646

47-
* Requirements: Python 2.7 or Python 3.4+ (PyPy works great)
47+
* Requirements: Python 2.7 or Python 3.5+ (PyPy works great)
4848

4949
* Install: ``pip install h11``
5050

h11/_readers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _decode_header_lines(lines):
5858
# Python 3, validate() takes either and returns matches as bytes. But
5959
# on Python 2, validate can return matches as bytearrays, so we have
6060
# to explicitly cast back.
61-
matches = validate(header_field_re, bytes(line))
61+
matches = validate(header_field_re, bytes(line), "illegal header line: {!r}", bytes(line))
6262
yield (matches["field_name"], matches["field_value"])
6363

6464

@@ -71,7 +71,7 @@ def maybe_read_from_IDLE_client(buf):
7171
return None
7272
if not lines:
7373
raise LocalProtocolError("no request line received")
74-
matches = validate(request_line_re, lines[0])
74+
matches = validate(request_line_re, lines[0], "illegal request line: {!r}", lines[0])
7575
return Request(
7676
headers=list(_decode_header_lines(lines[1:])), _parsed=True, **matches
7777
)
@@ -86,7 +86,7 @@ def maybe_read_from_SEND_RESPONSE_server(buf):
8686
return None
8787
if not lines:
8888
raise LocalProtocolError("no response line received")
89-
matches = validate(status_line_re, lines[0])
89+
matches = validate(status_line_re, lines[0], "illegal status line: {!r}", lines[0])
9090
# Tolerate missing reason phrases
9191
if matches["reason"] is None:
9292
matches["reason"] = b""
@@ -152,7 +152,7 @@ def __call__(self, buf):
152152
chunk_header = buf.maybe_extract_until_next(b"\r\n")
153153
if chunk_header is None:
154154
return None
155-
matches = validate(chunk_header_re, chunk_header)
155+
matches = validate(chunk_header_re, chunk_header, "illegal chunk header: {!r}", chunk_header)
156156
# XX FIXME: we discard chunk extensions. Does anyone care?
157157
# We convert to bytes because Python 2's `int()` function doesn't
158158
# work properly on bytearray objects.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"Programming Language :: Python :: 2",
2727
"Programming Language :: Python :: 2.7",
2828
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3.4",
3029
"Programming Language :: Python :: 3.5",
3130
"Programming Language :: Python :: 3.6",
3231
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
3333
"Topic :: Internet :: WWW/HTTP",
3434
"Topic :: System :: Networking",
3535
],

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = format, py27, py33, py34, py35, pypy
2+
envlist = format, py27, py35, py36, py37, py38, pypy
33

44
[testenv]
55
deps= -r{toxinidir}/test-requirements.txt

0 commit comments

Comments
 (0)