Skip to content

python-bareos: fix backslash usage in regex#1917

Merged
BareosBot merged 2 commits intobareos:masterfrom
joergsteffens:dev/joergs/master/python-bareos-fix
Aug 14, 2024
Merged

python-bareos: fix backslash usage in regex#1917
BareosBot merged 2 commits intobareos:masterfrom
joergsteffens:dev/joergs/master/python-bareos-fix

Conversation

@joergsteffens
Copy link
Member

@joergsteffens joergsteffens commented Aug 8, 2024

We used "\d" in a Python regex,
which is ambiguous
and is considered invalid in newer Python versions:
Python >= 3.8 will issue a DeprecationWarning,
Python >= 3.12 a SyntaxWarning
and later version will issue a SyntaxError.

Therefore we adapted it to the unambiguous "\d" sequence.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful

@joergsteffens joergsteffens self-assigned this Aug 8, 2024
@bruno-at-bareos
Copy link
Contributor

I suppose syntaxwarning instead systax right ? maybe worse fixing the typo in commit and pr title

@joergsteffens joergsteffens force-pushed the dev/joergs/master/python-bareos-fix branch from bbfceb9 to f37018e Compare August 8, 2024 12:57
@joergsteffens joergsteffens changed the title python-bareos: prevent regex systaxwarning python-bareos: fix backslash usage in regex Aug 8, 2024
@joergsteffens joergsteffens marked this pull request as ready for review August 8, 2024 14:33
@joergsteffens joergsteffens requested a review from sduehr August 8, 2024 14:33
@sduehr sduehr added this to the 24.0.0 milestone Aug 13, 2024
Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, looks good.

joergsteffens and others added 2 commits August 14, 2024 10:22
We used "\d" in a Python regex,
which is ambiguous
and is considered invalid in newer Python versions:
Python >= 3.8 will issue a DeprecationWarning,
Python >= 3.12 a SyntaxWarning
and later version will issue a SyntaxError.

Therefore we adapted it to the unambiguous "\\d" sequence.
@BareosBot BareosBot force-pushed the dev/joergs/master/python-bareos-fix branch from c4c9758 to 0d1d45c Compare August 14, 2024 10:22
@BareosBot BareosBot merged commit c866e9e into bareos:master Aug 14, 2024
@joergsteffens joergsteffens deleted the dev/joergs/master/python-bareos-fix branch September 25, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants