Skip to content

SyntaxWarning when using Python 3.12+ - vendor/memcache/memcache.py #2061

@Priiam

Description

@Priiam

Environment

  • OS Rocky Linux 9.3
  • Rez version 3.3.0
  • Rez python version 3.13.11

To Reproduce

  1. Build Rez v3.3.0 from source with Python 3.13.11
  2. Run rez -h

Expected behavior
The command should display the help message with no clutter.

$> rez -h
usage: rez [-h] [-i] [-V] [-v] COMMAND ...

[...]

Actual behavior
The command first displays a SyntaxtWarning, then prints out the help message.

$> rez -h
/software/rez/3.3.0/lib/python3.13/site-packages/rez/vendor/memcache/memcache.py:130: SyntaxWarning: invalid escape sequence '\ '
  debuglog,\ set, set_multi, add, replace, get, get_multi,

usage: rez [-h] [-i] [-V] [-v] COMMAND ...

[...]

The offending character appears to be this backward slash:

https://github.com/AcademySoftwareFoundation/rez/blame/e278f251f0d9843297d04859e81e88746068e990/src/rez/vendor/memcache/memcache.py#L130

Regression
I did not experience this bug in Rez v3.2.0 and Python 3.11.10 - Even though the offending character is present. This is likely due to Python3.12+ now reporting these syntax issues as SyntaxWarning instead of DeprecationWarning. I suspect the old-style DeprecationWarnings were being silenced.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions