[issue46526] iglob exclude patterns

2022-01-25 Thread Henning Leth


Henning Leth  added the comment:

Fix typo in 1st post

Code as i espected it would be writen:
... iglob(f'**/*[!{ignore}]', recursive=True)

--

___
Python tracker 
<https://bugs.python.org/issue46526>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46526] iglob exclude patterns

2022-01-25 Thread Henning Leth

New submission from Henning Leth :

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)

--
components: Library (Lib)
messages: 411682
nosy: leth.henning
priority: normal
severity: normal
status: open
title: iglob exclude patterns
type: behavior
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46526>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com