Skip to content

SyntaxWarning on Python 3.12 #57

@sergei-maertens

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.

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