Merge pull request #9274 from ThomasWaldmann/s3-urls
Some checks failed
Lint / lint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / security (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
CI / asan_ubsan (push) Has been cancelled
CI / native_tests (push) Has been cancelled
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Has been cancelled
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Has been cancelled
CI / vm_tests (OpenBSD, false, openbsd, 7.7) (push) Has been cancelled
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Has been cancelled
CI / windows_tests (push) Has been cancelled

fix S3 url description, fixes #9249
This commit is contained in:
TW 2026-01-28 14:23:01 +01:00 committed by GitHub
commit 33ee04fd3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -32,9 +32,10 @@ For SSH and SFTP URLs, the ``user@`` and ``:port`` parts are optional.
**Remote repositories** accessed via S3:
``(s3|b2):[profile|(access_key_id:access_key_secret)@][schema://hostname[:port]]/bucket/path`` see the boto3 docs for more details about credentials.
``(s3|b2):[(profile|(access_key_id:access_key_secret))@][scheme://hostname[:port]]/bucket/path`` see the boto3 docs for more details about credentials.
If you are connecting to AWS S3, ``[schema://hostname[:port]]`` is optional, but ``bucket`` and ``path`` are always required.
`scheme` is usually `https` here, hostname and optional port refer to your S3/B2 server, if that is not Amazon's.
Note: There is a known issue with some S3-compatible services, e.g., Backblaze B2. If you encounter problems, try using ``b2:`` instead of ``s3:`` in the URL.

View file

@ -471,7 +471,7 @@ class Location:
re.VERBOSE,
)
# (s3|b2):[profile|(access_key_id:access_key_secret)@][schema://hostname[:port]]/bucket/path
# (s3|b2):[(profile|(access_key_id:access_key_secret))@][scheme://hostname[:port]]/bucket/path
s3_re = re.compile(
r"""
(?P<s3type>(s3|b2)):
@ -481,7 +481,7 @@ class Location:
(?P<access_key_id>[^:@]+):(?P<access_key_secret>[^@]+) # access key and secret
)@)? # optional authentication
(
[^:/]+:// # scheme
[^:/]+:// # scheme (often https)
(?P<hostname>[^:/]+)
(:(?P<port>\d+))?
)? # optional endpoint