Skip to content

SyntaxWarning on Python 3.12 #57

Description

@sergei-maertens

I'm checking if I can upgrade a project to Python 3.12 yet, and while doing so, this library shows some syntax warnings:

2.508 /usr/local/lib/python3.12/site-packages/precise_bbcode/bbcode/placeholder.py:37: SyntaxWarning: invalid escape sequence '\w'                                                            
2.508   if not re.match('^[\w]+$', new_placeholder.name):                                                                                                                                     
2.510 /usr/local/lib/python3.12/site-packages/precise_bbcode/bbcode/tag.py:46: SyntaxWarning: invalid escape sequence '\s'                                                                    
2.510   if not re.match('^[^\s=]+$', new_tag.name):   

I believe these should be updated to raw strings, so adding a r -prefix should be sufficient.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions