Open Cybernetic-Ransomware opened 1 month ago
Same. Those affected strings definitely should be prefixed with raw modifier.
Not necessarily needs to be installed through Poetry in order to reproduce the warnings. Checked with Python versions: 3.10.15, 3.11.10.
docker run --rm -it python:3.11-slim bash
# inside the container:
pip install --no-compile ftrack-python-api
python -B -Wall -c "import ftrack_api"
--no-compile
seems important for reproduction, because pip might mask those warnings.
Output:
/usr/local/lib/python3.11/site-packages/ftrack_api/query.py:13: DeprecationWarning: invalid escape sequence '\d'
OFFSET_EXPRESSION = re.compile("(?P<offset>offset (?P<value>\d+))")
/usr/local/lib/python3.11/site-packages/ftrack_api/query.py:14: DeprecationWarning: invalid escape sequence '\d'
LIMIT_EXPRESSION = re.compile("(?P<limit>limit (?P<value>\d+))")
/usr/local/lib/python3.11/site-packages/pyparsing.py:108: DeprecationWarning: module 'sre_constants' is deprecated
import sre_constants
/usr/local/lib/python3.11/site-packages/ftrack_api/plugin.py:32: DeprecationWarning: invalid escape sequence '\*'
"""Find and load plugins in search *paths*.
/usr/local/lib/python3.11/site-packages/ftrack_api/structure/standard.py:133: DeprecationWarning: invalid escape sequence '\w'
"[^\w\.-]", self.illegal_character_substitute, value.decode("utf-8")
Those aren't the only problematic strings in the codebase. Somewhat crude regexp grep of the codebase yields the following:
test/unit/test_plugin.py
73: output = re.sub("(\w+)=\w+", '"\g<1>={}".format(\g<1>)', specification)
74: output = re.sub("\*args", "args", output)
75: output = re.sub("\*\*kwargs", "sorted(kwargs.items())", output)
Hi, recently tried to instal library by poetry. That started some background validations processes. So, right now i have a list of SyntaxWarning prints during stetting the containers. All of them are about invalid escape sequence. I think that could be simply fixed by raw string synthax:
r''
, but i wonder, did someone met inproper functionalities during the rular usage?Hi,
I recently tried to install the library using Poetry, which triggered some background validation processes. Currently, I am encountering a list of
SyntaxWarning
messages related to invalid escape sequences while setting up the containers. All of the warnings are about invalid escape sequences:I believe this could be easily fixed by using raw string syntax (
r''
), but I wonder if anyone has experienced any functionality issues related to this during regular usage?