-
Notifications
You must be signed in to change notification settings - Fork 35
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
naughty: handle fnmatch regex behaviour on Python 3.9 #5475
Conversation
})(["January 1, 2037", ["check-journal", "AFTER BOOT", ""], ["", "Reboot", ""], ["check-journal", "BEFORE BOOT", ""]])): Uncaught (in promise) Error: condition did not become true | ||
})(["January 1, 2037", ["check*journal", "AFTER BOOT", ""], ["", "Reboot", ""], ["check*journal", "BEFORE BOOT", ""]])): Uncaught (in promise) Error: condition did not become true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like the wrong fix. The root cause here is that the []
define character classes, but we really want to treat them verbatim. I.e. replacing the [
with \[
would feel more correct, unless fnmatch() doesn't deal with this? But I think we should avoid all fancy characters, and just use *
liberally, like *January 1, 2037*check-journal*"BEFORE BOOT"
or so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we test this against centos-9-stream/fedora-39 here? That would be nice I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't run against TF (that needs to happen in cockpit, or tested locally), but you can/should trigger c9s/f39 tests against cockpit here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woops, made the mistake of using image:fedora-39
so triggered a bit too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c9s can't be triggered sadly:
[jelle@t14s][~/projects/cockpit-bots]%./tests-trigger 5475 centos-9-stream/other@cockpit-project/cockpit
ignoring unknown context centos-9-stream/other@cockpit-project/cockpit
On Python 3.9 fnmatch cannot handle ["check-foo"] and gives an exception.
78766f1
to
bacca43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
On Python 3.9 fnmatch cannot handle ["check-foo"] and gives an exception.
See cockpit-project/cockpit#17226