* not working in glob
See original GitHub issueglob
raises an exception when I try to use a simple asterisk on the latest version :
In [5]: storage.glob(‘bucketx/a’) Out[5]: [‘bucketx/a/b’]
In [6]: storage.walk(‘bucketx/’) Out[6]: [‘bucketx/a/b/c/d/sh’]
In [7]: storage.glob(‘bucketx/*/b’)
ClientError Traceback (most recent call last) … ~/.virtualenvs/cassie-backup/lib/python3.6/site-packages/s3fs/core.py in info(self, path, **kwargs) 411 except (ClientError, ParamValidationError) as e: 412 logger.debug(“Failed to head path %s”, path, exc_info=True) –> 413 raise FileNotFoundError(path) 414 415 _metadata_cache = {}
FileNotFoundError: bucketx/*/b
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Python glob.glob always returns empty list - Stack Overflow
I faced a lot of problem in globbing on ubuntu. This code works fine on windows cv_img = [] for img in glob.glob('/home/itisha/Desktop/op/*....
Read more >glob.glob not working... : r/learnpython - Reddit
glob.glob not working... import glob c = glob.glob("*.txt") for file in c: print(file). This isn't printing anything, I don't know why.
Read more >glob.glob and gdal_translate not working - GIS Stack Exchange
The big issue was that it appears that you're trying to set your input and output filenames to a wildcard (the *.tif). Additionally...
Read more >glob — Unix style pathname pattern expansion ... - Python Docs
Source code: Lib/glob.py The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell, ......
Read more >glob not finding expected directory #15154 - bazelbuild/bazel
Description of the problem / feature request: I swear glob is haunted. It can find a sibling dir, but not an adjacent sibling...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would you like to have a go? I recommend by starting with
S3FileSystem._walk
, adding an optional parameterdictionaries=False
, and changing the last line of the function appropriately. The same parameter should then appear inwalk
, and so when glob calls it, you get both files and directories.I see no blocker to implement it. If we want to work with s3 as we do with files and directories it makes sense to me. I need to find paths that contain a certain folder without having to know exactly what’s stored in deeper levels. A workaround would be to use walk and then apply a regex on it what is done internally, something which can be done with the regular
glob.glob
.I don’t think it would be hard to implement. We could also limit the walk when the end of the pattern is reached (avoiding to walk through deeper level when we’re only interested in folders)