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

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

Conversation

pushfoo
Copy link
Member

@pushfoo pushfoo commented Feb 22, 2024

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.0
rootdir: /home/user/src/arcade
configfile: pyproject.toml
plugins: cov-3.0.0, mock-3.11.1
collected 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 ===================

@pushfoo pushfoo requested a review from einarf February 22, 2024 08:27
@einarf einarf merged commit 492c224 into pythonarcade:development Feb 22, 2024
7 checks passed
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

2 participants