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

aio-libs / yarl / 37735828222
98%

Build:
DEFAULT BRANCH: master
Ran 08 Oct 2026 06:08AM UTC
Jobs 1
Files 55
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

05 Oct 2026 06:56PM UTC coverage: 97.86%. Remained the same
37735828222

push

github

web-flow
Reject an empty host for http and friends in WHATWG mode (#1970)

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

## What do these changes do?

The WHATWG host parser fails on an empty host for every special scheme
except `file`, so `http://`, `http:///`, `http://?q` and `http://#` are
invalid URLs for the WHATWG URL Standard (and for Node's `URL`). WHATWG
mode accepted them. The root cause was printing: a URL of these schemes
without an authority, such as `http:?q` (kept as a reference to a base
for `join()`), was printed with `//` as `http://?q`, so the parser had
to accept `http://?q` to read it back.

WHATWG mode now prints such a URL without `//` (`http:`, `http:/`,
`http:?q`), compares it the same way, and rejects an empty authority for
`http`, `https`, `ws`, `wss` and `ftp` when parsing a string and when an
RFC 3986 mode URL is moved into WHATWG mode. `file` URLs still always
print `//`. RFC 3986 mode is unchanged.

This is a prerequisite for applying RFC 9110 section 4.2.1 (an http URI
with an empty host is invalid) in the RFC 3986 oracle of the conformance
report. With that oracle change alone, `http://?` and `http://#` would
land in "yarl differs, RFC 3986+3987 and WHATWG agree".

Conformance report: `http://?` and `http://#` moved from "WHATWG mode
differs from WHATWG, RFC mode follows RFC 3986+3987" to "yarl follows
each standard in its mode". `http:` against base
`https://example.org/foo/bar` stays in "WHATWG mode differs from
WHATWG", with yarl WHATWG mode now giving `http:` instead of `http://`
(WHATWG fails there; that is the join of a special-scheme reference
against a base with another scheme and is left for a later change). No
other row changed and "yarl differs, RFC 3986+3987 and WHATWG agree"
stays empty.

Existing tests updated because they pinned the old behaviour:
`tests/test_url_special_authority.py::test_kept_without_authority`
(WHATWG column for `http:`, `http:/`, `http:?q`; the `http://`,
`http:///` and `http:///?q` cases moved ... (continued)

97 of 194 branches covered (50.0%)

Branch coverage included in aggregate %.

79 of 80 new or added lines in 5 files covered. (98.75%)

19 existing lines in 3 files now uncovered.

11197 of 11347 relevant lines covered (98.68%)

0.99 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.48
0.0% tests/test_url_special_empty_host.py

Coverage Regressions

Lines Coverage ∆ File
13
97.41
0.0% yarl/_url.py
5
95.83
0.0% tests/test_url_special_authority.py
1
99.21
0.0% tests/test_url.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37735828222.1 08 Oct 2026 06:08AM UTC 55
97.86
GitHub Action Run
Source Files on build 37735828222
  • Tree
  • List 55
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37735828222
  • 1b9e3772 on github
  • Prev Build on master (#37579649662)
  • Next Build on master (#37891837053)
  • 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