• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aio-libs / yarl / 36474664183
98%

Build:
DEFAULT BRANCH: master
Ran 28 Sep 2026 07:49PM UTC
Jobs 1
Files 43
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Sep 2026 07:47PM UTC coverage: 97.652% (+0.004%) from 97.648%
36474664183

push

github

web-flow
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 xfa... (continued)

96 of 192 branches covered (50.0%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 2 files covered. (100.0%)

8762 of 8879 relevant lines covered (98.68%)

0.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36474664183.1 28 Sep 2026 07:49PM UTC 43
97.65
GitHub Action Run
Source Files on build 36474664183
  • Tree
  • List 43
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36474664183
  • 445bebb8 on github
  • Prev Build on master (#36473584484)
  • Next Build on master (#36529445476)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc