Avatar for the aio-libs user
aio-libs
yarl
BlogDocsChangelog

Performance History

Latest Results

Keep RFC mode host checks off the WHATWG build path Guard the calls with the mode at the call sites, so URL.build() and with_host() in the default mode do not pay for an extra function call.
asvetlov:conformance-mode-aware
9 hours ago
Strip trailing C0 control or space from parsed URLs (#1936) <!-- Thank you for your contribution! --> ## What do these changes do? `split_url()` stripped only leading C0 control characters and spaces, following a comment copied from `urllib.parse.urlsplit`, and percent-encoded the trailing ones: `URL("http://h/p ")` printed as `http://h/p%20`. It now strips both ends in both modes. For WHATWG mode this is the basic URL parser. For RFC 3986 mode the strict grammar rejects such input, but RFC 3986 appendix C asks software that accepts user-typed URIs to strip surrounding whitespace, and RFC mode already stripped the leading side and dropped tabs and newlines. In `tools/conformance/REPORT.md`, four rows move from "All three differ" to "RFC 3986 differs, yarl follows WHATWG" (`' foo.com '`, `'\t :foo.com \n'`, `non-special:opaque `, and one with leading and trailing control characters). Two rows of that category stay because of unrelated differences (query spaces encoded as `+`, and `c|` drive letters). The "yarl differs, RFC 3986 and WHATWG agree" section is unchanged. ## Are there changes in behavior for the user? Yes. Trailing C0 control characters and spaces in a parsed URL string are dropped instead of being percent-encoded, in both `encoded=False` and `encoded=True` parsing and in both modes. ## Is it a substantial burden for the maintainers to support this? No, it replaces `lstrip` with `strip`. ## Related issue number Follow-up to #1923. ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes exist - [x] Documentation reflects the changes - [ ] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` - [x] Add a new news fragment into the `CHANGES/` folder Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov. <details> <summary>Agent run details (optional, for reviewers)</summary> Tests: `pytest ./tests ./yarl -n auto` with the C extension: 2503 passed, 131 skipped, 57 xfailed; with `YARL_NO_EXTENSIONS=1`: 2120 passed, 138 skipped, 55 xfailed. Conformance: `python tools/conformance/compare.py --check` passes after `make conformance`. Docs: sphinx doctest 192 tests, 0 failures; the spelling build shows only local false positives in `index.rst` contractions, which are unrelated. Lint: `pre-commit run` on the changed files passes, including mypy. </details>
master
10 hours ago

Latest Branches

CodSpeed Performance Gauge
0%
Measure both modes in the conformance report#1938
9 hours ago
71ec093
asvetlov:conformance-mode-aware
CodSpeed Performance Gauge
0%
10 hours ago
fc5e0d5
asvetlov:special-authority-no-slashes
CodSpeed Performance Gauge
0%
Strip trailing C0 control or space from parsed URLs#1936
10 hours ago
b2a2421
asvetlov:strip-trailing-space
Ā© 2026 CodSpeed Technology
Home Terms Privacy Docs