Skip to content
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

SyntaxWarning: invalid escape sequence '\d' #79

Open
pabutusa opened this issue Nov 8, 2024 · 3 comments · May be fixed by #80
Open

SyntaxWarning: invalid escape sequence '\d' #79

pabutusa opened this issue Nov 8, 2024 · 3 comments · May be fixed by #80

Comments

@pabutusa
Copy link

pabutusa commented Nov 8, 2024

Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adif
/home/roschews/pyqso/pyqso/adif.py:272: SyntaxWarning: invalid escape sequence '\d'
  pattern = re.compile("<(.*?):(\d*).*?>([^<]+)")

I'm really not great at REGEX .... but should the \d be a \\d ??

According to the google:
Back in Python 3.6, using invalid escape sequences in string literals was deprecated (bpo-27364).

@auslaner
Copy link

auslaner commented Nov 8, 2024

I believe it would work to just preface the string with an 'r' to denote it as a raw string.

pattern = re.compile(r"<(.*?):(\d*).*?>([^<]+)")

@tomswartz07 tomswartz07 linked a pull request Nov 14, 2024 that will close this issue
@tomswartz07
Copy link

👋🏻 I made a PR (which will probably not be merged- it looks like this project is loong abandoned) which fixes this problem.

I'll probably continue to work on changes in my fork: https://github.com/tomswartz07/pyqso

@pabutusa
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants