-
-
Notifications
You must be signed in to change notification settings - Fork 862
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ruff linter: Use the default line-length (#2922)
Co-authored-by: Tester <[email protected]> Co-authored-by: Kar Petrosyan <[email protected]>
- Loading branch information
1 parent
90d71e6
commit fd60b18
Showing
15 changed files
with
89 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,21 +51,23 @@ class URL: | |
assert url.raw_host == b"xn--fiqs8s.icom.museum" | ||
* `url.port` is either None or an integer. URLs that include the default port for | ||
"http", "https", "ws", "wss", and "ftp" schemes have their port normalized to `None`. | ||
"http", "https", "ws", "wss", and "ftp" schemes have their port | ||
normalized to `None`. | ||
assert httpx.URL("http://example.com") == httpx.URL("http://example.com:80") | ||
assert httpx.URL("http://example.com").port is None | ||
assert httpx.URL("http://example.com:80").port is None | ||
* `url.userinfo` is raw bytes, without URL escaping. Usually you'll want to work with | ||
`url.username` and `url.password` instead, which handle the URL escaping. | ||
* `url.userinfo` is raw bytes, without URL escaping. Usually you'll want to work | ||
with `url.username` and `url.password` instead, which handle the URL escaping. | ||
* `url.raw_path` is raw bytes of both the path and query, without URL escaping. | ||
This portion is used as the target when constructing HTTP requests. Usually you'll | ||
want to work with `url.path` instead. | ||
* `url.query` is raw bytes, without URL escaping. A URL query string portion can only | ||
be properly URL escaped when decoding the parameter names and values themselves. | ||
* `url.query` is raw bytes, without URL escaping. A URL query string portion can | ||
only be properly URL escaped when decoding the parameter names and values | ||
themselves. | ||
""" | ||
|
||
def __init__( | ||
|
@@ -115,7 +117,8 @@ def __init__( | |
self._uri_reference = url._uri_reference.copy_with(**kwargs) | ||
else: | ||
raise TypeError( | ||
f"Invalid type for url. Expected str or httpx.URL, got {type(url)}: {url!r}" | ||
"Invalid type for url. Expected str or httpx.URL," | ||
f" got {type(url)}: {url!r}" | ||
) | ||
|
||
@property | ||
|
@@ -305,7 +308,8 @@ def raw(self) -> RawURL: | |
Provides the (scheme, host, port, target) for the outgoing request. | ||
In older versions of `httpx` this was used in the low-level transport API. | ||
We no longer use `RawURL`, and this property will be deprecated in a future release. | ||
We no longer use `RawURL`, and this property will be deprecated | ||
in a future release. | ||
""" | ||
return RawURL( | ||
self.raw_scheme, | ||
|
@@ -342,7 +346,9 @@ def copy_with(self, **kwargs: typing.Any) -> "URL": | |
For example: | ||
url = httpx.URL("https://www.example.com").copy_with(username="[email protected]", password="a secret") | ||
url = httpx.URL("https://www.example.com").copy_with( | ||
username="[email protected]", password="a secret" | ||
) | ||
assert url == "https://jo%40email.com:a%[email protected]" | ||
""" | ||
return URL(self, **kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters