Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the cache lookup in _info #840

Merged
merged 3 commits into from
Dec 16, 2023

Conversation

YeahItsMeAgain
Copy link
Contributor

The info function retrieved the fullpath from the cache in its initial lookup but used the given path (which is a user given variable) on the second instance.

Fixed it to use fullpath both times.

You can reproduce the bug with the following code:

# Filling the cache.
fs.isdir("/bucket")

# The cache seems ok.
print(fs.dircache._cache)

# The cache "miss" happens now because the key doesn't start with "/".
print(fs.info("/bucket/file"))

@martindurant
Copy link
Member

Since you already have a test in the PR description, can you please add this to the code to make sure we don't accidentally undo this sometime?

@YeahItsMeAgain
Copy link
Contributor Author

Sure, I changed the existing test :)

@martindurant martindurant merged commit 34a3219 into fsspec:main Dec 16, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants