Skip to content

Docstrings are not raw strings #5106

@aiven-amartin

Description

@aiven-amartin

Before filling a bug

  • have you checked the faq for known issues.
  • have you checked existing issues

Describe the bug

The python azure sdk uses this module to generate its models. These models all raise SyntaxWarnings b/c the generated docstrings have invalid escape charaters. Instead of having the user of this library manually edit their api docs to be python escape compliant, the generated methods and classes should all generate raw-strings instead of escape strings. (i.e. it should be r"""... instead of just """...)

Expected behavior
All docstrings should be raw-strings since the content likely includes escape characters we do not intend to escape.

Additional context
Python will soon upgrade these to errors from warnings, so this needs to be fixed soon.

A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence, use raw strings for regular expression: re.compile(r"\d+.\d+")). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions