Skip to content

Infinite recursion in walk() when S3 bucket contains object with key /Β #953

Description

@SamirAltos

We've run into a reproducible issue where calling walk() on an S3 bucket causes infinite recursion if the bucket contains an object with the key /

This happens because:

  • S3 allows an object to be created with the key /
  • ls() returns it as a "directory" (i.e. common prefix /)
  • walk() sees that as a subdirectory and recurses into it
  • But that "subdirectory" is just the bucket root again β†’ leading to infinite recursion
  • This eventually leads to a RecursionError: maximum recursion depth exceeded.

Let us know if this is something you'd consider filtering out at the s3fs level. Happy to provide a test case or additional details!

Thanks for the great library πŸ™

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions