fix S3 url description, fixes #9249

- profile also must be followed by @
- in URL specs, it is "scheme", not "schema"
- note that the scheme is usually https
This commit is contained in:
Thomas Waldmann 2026-01-28 12:12:26 +01:00
parent 6a72b12b1e
commit 4073bb263f
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
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