Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
617 stars 239 forks source link

Fix SyntaxWarning: invalid escape sequence #1414

Open kevinoid opened 1 month ago

kevinoid commented 1 month ago

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 https://github.com/python/cpython/issues/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