Skip to content

Type generated put destinations and document path addressing limits (#1381 step 4) #1404

Open

Description

@laughingman7743

Part of #1381 (step 4 of 4). It covers the rest of #1381.

Current state (758adee)

put("x?versionId=v1", "bucket/up/") raises ValueError: Cannot write to the file with the version specified.

The local file name ends in what looks like a version query. put builds the destination bucket/up/x?versionId=v1, which is then parsed as a version. The async _put builds its destinations through the same _put_pairs.

Scope

  1. The S3 destinations that put and _put build from local names are typed addresses. The suffix taken from a local name is never parsed for a version.
  2. Document the following (decisions 2, 3 and 4 of the Settle the response models, S3Object, and the listing cache #1341 audit):
    • A key that looks like a version path cannot be addressed by a string path. S3Core reaches it with an explicit S3Path. There is no escape syntax.
    • bucket// names the key / for single-object operations and the bucket for listings. A recursive chmod of it does not change the bucket ACL.
    • S3Path(bucket, "") is the bucket path.
    • Some compositions still go through strings and do not keep this identity. Examples are fsspec's open_files, FSMap, and the strings of find(), ls() and expand_path() passed back in.

Activity

  1. laughingman7743 commented on Nov 16, 2026

    @laughingman7743
    MemberAuthor

    Carried over from the review of #1421 (step 3), for this step:

    1. Typed file paths. S3File and S3FileTarget.resolve() now accept an S3Path. The file's path is the string of that S3Path, so a file opened for a key such as a/x?versionId=null without a version has a path string that names the null version of a/x.
      • sign(), metadata(), getxattr() and setxattr() of such a file look up self.path as a string.
      • A pickled file reopens with fs.open(self.path).
      • In Act on listed identities in pairing and copy/mv/get (GH-1403) #1421 only get_file() opens a typed path, in "rb", and calls none of these.
      • Either give those methods the file's bucket, key and version, or document them as limits of string addressing.
    2. Typed write modes. The "wb", "ab" and "xb" modes of a typed path go through info(), cat_file() and _object_exists(), which accept an S3Path since Act on listed identities in pairing and copy/mv/get (GH-1403) #1421, but nothing exercises them yet. put() destinations will, so add their tests here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions