Skip to content

Use fnmatch again for excludes #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

mwilck
Copy link
Contributor

@mwilck mwilck commented May 15, 2025

According to the documentation, the value of the "excludes" parameter for obs_scm is a glob. But since commit 140a127 ("fix excludes for obscpio") the code treats this value as a regular expression, which leads to wrong matching results and may lead to python crashes if the glob expression starts with "*".

Fixes: #520
Fixes: 140a127 ("fix excludes for obscpio")

According to the documentation, the value of the "excludes" parameter for
obs_scm is a glob. But since commit 140a127 ("fix excludes for obscpio") the
code treats this value as a regular expression, which leads to wrong matching
results and may lead to python crashes if the glob expression starts with "*".

Fixes: openSUSE#520
Fixes: 140a127 ("fix excludes for obscpio")
@mwilck
Copy link
Contributor Author

mwilck commented May 19, 2025

This PR breaks test_tar_exclude_re.
Not unexpectedly, because my patch replaces re matching by glob matching. Commit cfb2e44 suggests that the change from globbing to re matching was deliberate.

But this contradicts the documentation, and it breaks legitimate code. If matching by regular expression is desired, perhaps that could be achieved with some additional syntax, e.g. <exclude match="re">...</exclude> ?

@mwilck
Copy link
Contributor Author

mwilck commented Jun 12, 2025

Obsoleted by #525

@mwilck mwilck closed this Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tar_scm fails with "sre_constants.error: nothing to repeat at position 34"
1 participant