Skip to content

autojoin_on_invite.py 0.10: use raw string for INVITE regex to fix SyntaxWarning - #615

Open
cnsunyour wants to merge 1 commit into
weechat:mainfrom
cnsunyour:patch-1
Open

cnsunyour wants to merge 1 commit into
weechat:mainfrom
cnsunyour:patch-1

Conversation

@cnsunyour

Copy link
Copy Markdown
Contributor

Script info

  • Script name: autojoin_on_invite.py

  • Version: 0.10

  • Requirements: none (WeeChat API and Python standard library only)

  • Min WeeChat version: 0.3.0

  • Script tags: irc

Description

Use a raw string for SearchStr so that \@ is not treated as an invalid
escape sequence. Since Python 3.12, invalid escape sequences in plain string
literals trigger a SyntaxWarning: invalid escape sequence '\@' every time
the script is loaded, and they are planned to become a syntax error in a
future Python release.

A raw string produces exactly the same string content and regex behavior on
every Python version, so this is a warning fix only, with no functional change.

Checklist (script update)

  • Author has been contacted
  • Single commit, single file added
  • Commit message format: script_name.py X.Y: …
  • Script version and Changelog have been updated
  • For Python script: works with Python 3 (Python 2 support is optional)
  • Score 100 / 100 displayed by weechat-script-lint

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 this pull request may close these issues.

1 participant