shikhabhadoria opened a new pull request, #41390:
URL: https://github.com/apache/beam/pull/41390
Fixes #41375.
### Description
When `LocalFileSystem.match()` (or `LocalFileSystem.delete()`) is called
with a relative glob pattern in the current working directory that contains no
directory separator (such as `'users.json*'` or `'**'`),
`_url_dirname(prefix_or_dir)` returns `''` (`os.path.dirname('users.json') ==
''`). `LocalFileSystem._list('')` then checks `if not self.exists('')` which is
`False`, returning zero matches.
This change updates `LocalFileSystem._list()` to walk `os.curdir` (`'.'`)
when `dir_or_prefix` is empty (`''`) and strip the leading `'./'` (or `'.\\'`)
prefix from yielded paths so `self.match_files(file_metadatas, pattern)`
matches relative patterns in the current working directory.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [x] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
- [x] Replace these instructions with a description of your change and why
you have made it.
- [x] Mention the appropriate issue in your description (for example:
`addresses #123` or `fixes #456`).
- [ ] Update `CHANGES.md` with noteworthy changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]