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

Fix SyntaxWarning: invalid escape sequence #1414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinoid
Copy link

Loading azure-devops/azext_devops/devops_sdk/*/feed/models.py with Python 3.12 produces the following warnings:

/path/to/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py:101: SyntaxWarning: invalid escape sequence '\,'
  """FeedCore.
/path/to/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py:209: SyntaxWarning: invalid escape sequence '\,'
  """FeedUpdate.
/path/to/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py:985: SyntaxWarning: invalid escape sequence '\,'
  """Feed.

This occurs due to the presence of the invalid escape sequence \, in docstrings for FeedCore, FeedUpdate, and Feed, which produces a SyntaxWarning in Python 3.12 as a result of python/cpython#98401.

Unresolved Issues

This PR changes \, to \\,, which avoids the SyntaxWarning, but doesn't fix the ambiguity of what is being communicated: \\, now appears twice in the list. Is the intention to indicate that comma and backslash are illegal? Perhaps ,, or \\,, would be clearer?

Thanks for considering,
Kevin

Loading azure-devops/azext_devops/devops_sdk/*/feed/models.py with
Python 3.12 produces the following warnings:

    /path/to/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py:101: SyntaxWarning: invalid escape sequence '\,'
      """FeedCore.
    /path/to/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py:209: SyntaxWarning: invalid escape sequence '\,'
      """FeedUpdate.
    /path/to/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py:985: SyntaxWarning: invalid escape sequence '\,'
      """Feed.

This occurs due to the presence of the invalid escape sequence `\,` in
docstrings for FeedCore, FeedUpdate, and Feed, which produces a
SyntaxWarning in Python 3.12 as a result of
<python/cpython#98401>.

Signed-off-by: Kevin Locke <[email protected]>
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.

None yet

1 participant