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

aio-libs / yarl / 37020030388
98%

Build:
DEFAULT BRANCH: master
Ran 02 Oct 2026 02:29PM UTC
Jobs 1
Files 52
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 02:27PM UTC coverage: 97.863% (+0.02%) from 97.844%
37020030388

push

github

web-flow
Drop an empty password in WHATWG mode (#1965)

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

## What do these changes do?

WHATWG serializes userinfo as the username, then `:` and the password
only when the password is not empty, then `@` only when either is not
empty. yarl kept the empty password in WHATWG mode, so `http://a:@h`
stayed `http://a:@h` instead of `http://a@h`, and `http://:@h` kept
`:@`.

WHATWG mode now drops an empty password in the parser, `URL.build()`
(with `user`/`password` and with `authority=`), `with_password('')`,
`join()` with a `//u:@h` reference and a change of mode from RFC 3986.
`with_user()`, `with_host()`, `with_port()` and `with_scheme()` rebuild
the netloc from parts that no longer carry an empty password, so they
follow. RFC 3986 mode is unchanged, and `encoded=True` parsing and
building keep the input as is, as they do for the `file` host rules.

## Are there changes in behavior for the user?

Yes, in WHATWG mode (the default). `URL('http://a:@h')` is `http://a@h`,
and its `password` and `raw_password` are `None` instead of `''`. This
matches how yarl already reports an empty username as `None`; WHATWG's
empty string password maps to yarl's `None`. `with_password('')` clears
the password there. RFC 3986 mode still keeps `''`.

Conformance report: 8 rows move from *WHATWG mode differs from WHATWG,
RFC mode follows RFC 3986+3987* to *yarl follows each standard in its
mode*; no other row changes:

- `https://test:@test`, `https://:@test`, `http://a:@www.example.com`,
`http://:@www.example.com` (other)
- `http:a:@www.example.com`, `http:/a:@www.example.com` (special scheme
without an authority)
- `non-special://test:@test/x`, `non-special://:@test/x` (non-special
scheme)

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

No. The checks sit on the userinfo branches only, so URLs without
userinfo take the same path as before.

## Related issue number

N/A

## Checklist

- [x] I think the code is well writte... (continued)

97 of 194 branches covered (50.0%)

Branch coverage included in aggregate %.

192 of 194 new or added lines in 4 files covered. (98.97%)

10848 of 10990 relevant lines covered (98.71%)

0.99 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
98.77
tests/test_url_userinfo_whatwg.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37020030388.1 02 Oct 2026 02:29PM UTC 52
97.86
GitHub Action Run
Source Files on build 37020030388
  • Tree
  • List 52
  • 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 #37020030388
  • c91b25e6 on github
  • Prev Build on master (#37009328384)
  • Next Build on master (#37026618109)
  • 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