This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: iglob exclude patterns
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: hleth
Priority: normal Keywords:

Created on 2022-01-25 22:41 by hleth, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg411682 - (view) Author: hleth (hleth) Date: 2022-01-25 22:41
Got a project where I am looking for all files in a project dir, except the some files/dir/extentions that should be ignored.

Found a possible bug:
- the set has to be defined even though it was a set when defined
- f-string doesn´t work as I would expect

working code from my project:
ignore = {'*.tmp', 'test.txt', './tmp/*'}
for file in iglob('**/*[!f"{set(ignore)}"]', recursive=True):

code as i espected it would be writen:
... iglob(f'**/*[!{"ignore"}]', recursive=True)
msg411683 - (view) Author: hleth (hleth) Date: 2022-01-25 22:44
Fix typo in 1st post

Code as i espected it would be writen:
... iglob(f'**/*[!{ignore}]', recursive=True)
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90684
2022-01-25 22:44:29hlethsetmessages: + msg411683
2022-01-25 22:41:06hlethcreate