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

aio-libs / yarl / 36471421231
98%

Build:
DEFAULT BRANCH: master
Ran 28 Sep 2026 07:20PM 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:19PM UTC coverage: 97.648% (+0.02%) from 97.633%
36471421231

push

github

web-flow
Compare URLs with empty components the way they print (#1934)

<!-- Thank you for your contribution! -->

## What do these changes do?

Two review findings on #1929 were marked resolved but not fixed:

- `==` and `hash()` ignored an empty authority for every special scheme,
so in RFC mode `URL("http:/x", mode="rfc")` and `URL("http:///x",
mode="rfc")` printed differently but compared equal and collapsed into
one dictionary key. The comparison now follows what `str()` writes: the
empty authority is ignored only where it is always printed, i.e. a
special scheme in WHATWG mode.
- `URL.build(path="//a", encoded=True)` prints `/.//a`, but
`URL("/.//a", encoded=True)` kept the serialization-only `/.` in its
path. The encoded parser now drops it the same way the unencoded one
does. So that a literal `/.` segment in that place survives too, `str()`
adds the `/.` to any authority-less path that is `//...` behind zero or
more `/.` segments and the parsers drop exactly one: `/.//a` is written
`/././/a`.

The CodeQL "redundant comparison" alerts on `test_ordering` are gone
too: each ordering operator is now checked on its own pair of URLs.

## Are there changes in behavior for the user?

Yes, for URLs without an authority in RFC mode only: `file:/p` and
`file:///p` (and `http:/x` vs `http:///x`) no longer compare equal
there, because they print differently. In the default WHATWG mode both
forms still print `file:///p` and stay equal. RFC mode is not released
yet, so this is a bugfix rather than a breaking change.

## Is it a substantial burden for the maintainers to support this?

No, it narrows one property and adds three lines to the encoded parser.

## Related issue number

Follow-up to #1929.

## 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/` folde... (continued)

96 of 192 branches covered (50.0%)

Branch coverage included in aggregate %.

76 of 76 new or added lines in 3 files covered. (100.0%)

8749 of 8866 relevant lines covered (98.68%)

0.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36471421231.1 28 Sep 2026 07:20PM UTC 43
97.65
GitHub Action Run
Source Files on build 36471421231
  • Tree
  • List 43
  • Changed 3
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36471421231
  • 66cb4c08 on github
  • Prev Build on master (#36461803082)
  • Next Build on master (#36473584484)
  • 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