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

I can open an S3 file in root, but not in a subdirectory #62

Closed
davidparks21 opened this issue Nov 17, 2019 · 3 comments
Closed

I can open an S3 file in root, but not in a subdirectory #62

davidparks21 opened this issue Nov 17, 2019 · 3 comments

Comments

@davidparks21
Copy link

Originally posted here:
https://stackoverflow.com/questions/57227152/opening-a-file-in-pyfilesystems-s3-filesystem-fails

I'm able to open a file in the root of an S3 bucket without a problem, however I cannot open a file with a standard path prefix:

>>> s3fs.listdir('dfparks/test')
['test.txt']
>>> s3fs.open('dfparks/test/test.txt')

I get the error:

fs.errors.ResourceNotFound: resource 'dfparks/test/test.txt' not found

I've tried every variant of the path / s3 url I can think of but I always get the not found error.

@mrk-its
Copy link

mrk-its commented Nov 17, 2019

Could you try to reproduce this using code from #60? (you can simply install fs-s3fs-ng package - it is the same as fs-s3fs==1.1.1 but with #60 and #61 applied)

@willmcgugan
Copy link
Member

@davidparks21 Did you create the test directory with S3FS?

S3FS has some limitations, which are documented here.

@davidparks21
Copy link
Author

davidparks21 commented Nov 17, 2019

I understand now, that does appear to be the issue, I hadn't caught that detail in the docs. This might be worth a big red flag in the docs.

@mrk-its your PR is brilliant, it solved my next problem too. I was doing a test to see if I could open a large file (3+ GB) and only read the first few bytes of its header. With fs_s3fs_ng it worked no problem, but with fs_s3fs with strict=False I was able to open the file it appears, but it started reading the entire file in.

I'll watch your PRs, you've got my vote for sure! :)

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

No branches or pull requests

3 participants