parent
f3eb3c90fd
commit
0006ed0547
@ -2,6 +2,7 @@
|
|||||||
The _compat module is used for code which requires branching between different
|
The _compat module is used for code which requires branching between different
|
||||||
Python environments. It is excluded from the code coverage checks.
|
Python environments. It is excluded from the code coverage checks.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import ssl
|
import ssl
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ Handlers for Content-Encoding.
|
|||||||
|
|
||||||
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
|||||||
@ -30,6 +30,7 @@ Our exception hierarchy:
|
|||||||
x ResponseNotRead
|
x ResponseNotRead
|
||||||
x RequestNotRead
|
x RequestNotRead
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|||||||
@ -23,6 +23,7 @@ client = httpx.Client(transport=transport)
|
|||||||
transport = httpx.HTTPTransport(uds="socket.uds")
|
transport = httpx.HTTPTransport(uds="socket.uds")
|
||||||
client = httpx.Client(transport=transport)
|
client = httpx.Client(transport=transport)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|||||||
@ -15,6 +15,7 @@ Previously we relied on the excellent `rfc3986` package to handle URL parsing an
|
|||||||
validation, but this module provides a simpler alternative, with less indirection
|
validation, but this module provides a simpler alternative, with less indirection
|
||||||
required.
|
required.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|||||||
@ -93,12 +93,11 @@ text = "\n---\n\n[Full changelog](https://github.com/encode/httpx/blob/master/CH
|
|||||||
pattern = 'src="(docs/img/.*?)"'
|
pattern = 'src="(docs/img/.*?)"'
|
||||||
replacement = 'src="https://raw.githubusercontent.com/encode/httpx/master/\1"'
|
replacement = 'src="https://raw.githubusercontent.com/encode/httpx/master/\1"'
|
||||||
|
|
||||||
# https://beta.ruff.rs/docs/configuration/#using-rufftoml
|
[tool.ruff.lint]
|
||||||
[tool.ruff]
|
|
||||||
select = ["E", "F", "I", "B", "PIE"]
|
select = ["E", "F", "I", "B", "PIE"]
|
||||||
ignore = ["B904", "B028"]
|
ignore = ["B904", "B028"]
|
||||||
|
|
||||||
[tool.ruff.isort]
|
[tool.ruff.lint.isort]
|
||||||
combine-as-imports = true
|
combine-as-imports = true
|
||||||
|
|
||||||
[tool.ruff.lint.per-file-ignores]
|
[tool.ruff.lint.per-file-ignores]
|
||||||
|
|||||||
@ -3,6 +3,7 @@ Integration tests for authentication.
|
|||||||
|
|
||||||
Unit tests for auth classes also exist in tests/test_auth.py
|
Unit tests for auth classes also exist in tests/test_auth.py
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import netrc
|
import netrc
|
||||||
import os
|
import os
|
||||||
|
|||||||
@ -3,6 +3,7 @@ Unit tests for auth classes.
|
|||||||
|
|
||||||
Integration tests also exist in tests/client/test_auth.py
|
Integration tests also exist in tests/client/test_auth.py
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from urllib.request import parse_keqv_list
|
from urllib.request import parse_keqv_list
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@ -462,8 +462,8 @@ class TestHeaderParamHTML5Formatting:
|
|||||||
assert expected in request.read()
|
assert expected in request.read()
|
||||||
|
|
||||||
def test_unicode_with_control_character(self):
|
def test_unicode_with_control_character(self):
|
||||||
filename = "hello\x1A\x1B\x1C"
|
filename = "hello\x1a\x1b\x1c"
|
||||||
expected = b'filename="hello%1A\x1B%1C"'
|
expected = b'filename="hello%1A\x1b%1C"'
|
||||||
files = {"upload": (filename, b"<file content>")}
|
files = {"upload": (filename, b"<file content>")}
|
||||||
request = httpx.Request("GET", "https://www.example.com", files=files)
|
request = httpx.Request("GET", "https://www.example.com", files=files)
|
||||||
assert expected in request.read()
|
assert expected in request.read()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user