Skip to content

Escape a Win32 path which Python thinks is an escape code - #1983

Merged
einarf merged 3 commits into
pythonarcade:developmentfrom
pushfoo:escape_backslash_r_deprecated_escape_code
Feb 22, 2024
Merged

Escape a Win32 path which Python thinks is an escape code#1983
einarf merged 3 commits into
pythonarcade:developmentfrom
pushfoo:escape_backslash_r_deprecated_escape_code

Conversation

@pushfoo

Copy link
Copy Markdown
Member

Changes

  • Escape the backslash before an R in a docstring
  • Escape the other backslashes in the same docstring:
    • More consistent
    • Stops it from looking like a typo which someone would waste time fixing

Why

While testing #1982, I once again ran into pytest outputting noisy error messages about \R being a deprecated escape code:

$ pytest -k test_color_type================================ test session starts ================================platform linux -- Python 3.9.2, pytest-8.0.1, pluggy-1.4.0rootdir: /home/user/src/arcadeconfigfile: pyproject.tomlplugins: cov-3.0.0, mock-3.11.1collected 786 items / 768 deselected / 18 selected tests/unit/color/test_color_type.py .................. [100%]================================= warnings summary ==================================tests/unit/test_example_docstrings.py:47 /home/user/src/arcade/tests/unit/test_example_docstrings.py:47: DeprecationWarning: invalid escape sequence \R """-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html=================== 18 passed, 768 deselected, 1 warning in 2.57s ===================

Comment threadtests/unit/test_example_docstrings.py Outdated
@pushfoo
pushfoo requested a review from einarfFebruary 22, 2024 08:27
@einarf
einarf merged commit 492c224 into pythonarcade:developmentFeb 22, 2024
Sign up for freeto 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.

2 participants

@pushfoo@einarf