macos_security icon indicating copy to clipboard operation
macos_security copied to clipboard

SyntaxWarning for python string \| with sufficiently new python version

Open bernstei opened this issue 1 year ago • 0 comments

Running generate_guidance.py under python 3.12 leads to many SyntaxWarning, e.g.

./scripts/generate_guidance.py:2112: SyntaxWarning: invalid escape sequence '\|'
  rule_id=rule_yaml['id'].replace('|', '\|'),

It appears that most recent python syntax interprets '\|' as an attempt to escape the |. I think it can be replaced with r'\|' or '\\|', but a, I'm not 100% sure this is right, and b, I'm not sure what python versions this project intends to support and whether they support this new raw string syntax.

bernstei avatar Feb 22 '24 01:02 bernstei