artifactory icon indicating copy to clipboard operation
artifactory copied to clipboard

ArtifactoryPath.glob() doesn't support case in the patern

Open dogbert911 opened this issue 2 years ago • 0 comments

I have artifacts with capitalize and non-capitalize names. When I'm using glob to search artifacts with capitalize names, it returns all of them. But I expect only capitalized.

Example:

# My artifactory:
# /aaa/file_1.txt
# /aaa/file_2.txt
# /aaa/FILE_3.txt

for p in ArtifactoryPath('aaa').glob('FILE*'):
    print(p)
# Real Out:
# /aaa/file_1.txt
# /aaa/file_2.txt
# /aaa/FILE_3.txt
#
# My expectation:
# /aaa/FILE_3.txt

It happens because compile_pattern function contain next code:

re.compile(fnmatch.translate(pattern), re.IGNORECASE)

to fix it should be next:

- re.compile(fnmatch.translate(pattern), re.IGNORECASE)
+ re.compile(fnmatch.translate(pattern))

dogbert911 avatar Aug 12 '23 18:08 dogbert911