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

aio-libs / yarl / 37271270219
98%

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

02 Oct 2026 06:24PM UTC coverage: 97.856% (-0.01%) from 97.868%
37271270219

push

github

web-flow
Keep an authority that is only an empty port in RFC 3986 mode (#1967)

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

## What do these changes do?

RFC 3986 section 6.2.3 drops an empty port together with its ":", so
`sc://:/` is `sc:///`: the authority is present and empty. In RFC 3986
mode yarl split the netloc `:` into no host and no port and then rebuilt
it as an empty netloc without marking the authority as present, so
`URL("sc://:/", mode="rfc")` printed `sc:/`. The parser now keeps an
empty authority in that case, and `URL.build(authority=":", mode="rfc")`
does the same. As a join reference, `//:/p` against `sc://x/y` now gives
`sc:///p` (RFC 3986 section 5.2.2) instead of keeping the base host.
`sc://:12/`, `sc://@/` and `sc://u@:/` were already right and are
unchanged.

WHATWG mode is unchanged: it rejects a port without a host, which
matches Node's `URL` for every touched case. `http://:/` is still
rejected in RFC mode too (RFC 9110 section 4.2.1).

Conformance report: one row moved, `sc://:/`, from "RFC mode differs
from RFC 3986+3987, WHATWG mode follows WHATWG" to "yarl follows each
standard in its mode". No other row changed section and "yarl differs,
RFC 3986+3987 and WHATWG agree" stays empty. The other "empty host" rows
in that section have different root causes and are not touched here: the
`///example.org/../path` family keeps the base host for http on purpose
(`_join_with_empty()` and `SCHEME_REQUIRES_HOST`), and
`http://user@/www.example.com` and friends are rejected under RFC 9110.

No existing test pinned the old RFC result and no strict xfail covered
it; `tests/test_url_parsing.py::TestParsing::test_no_host[sc://:/]` pins
the WHATWG rejection, which still holds.

## Are there changes in behavior for the user?

Yes, in RFC 3986 mode only: an authority that is only an empty port is
kept as an empty authority (`sc://:/` is `sc:///`) instead of being
dropped (`sc:/`).

## Is it a substantial burden for the maintainers to support this?
... (continued)

97 of 194 branches covered (50.0%)

Branch coverage included in aggregate %.

78 of 81 new or added lines in 2 files covered. (96.3%)

11132 of 11281 relevant lines covered (98.68%)

0.99 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
96.0
tests/test_url_empty_port_rfc.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37271270219.1 05 Oct 2026 06:14AM UTC 54
97.86
GitHub Action Run
Source Files on build 37271270219
  • Tree
  • List 54
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37271270219
  • 40594eb9 on github
  • Prev Build on master (#37026618109)
  • Next Build on master (#37359747651)
  • 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