Skip to content

Comments

mark Urn.expression as a regex#140

Open
azmeuk wants to merge 1 commit intoezhov-evgeny:developfrom
azmeuk:regex-warning
Open

mark Urn.expression as a regex#140
azmeuk wants to merge 1 commit intoezhov-evgeny:developfrom
azmeuk:regex-warning

Conversation

@azmeuk
Copy link

@azmeuk azmeuk commented Dec 18, 2023

It fixes this warning that is raised by pytest on projects depending on webdavclient3

    webdav3/urn.py:11: DeprecationWarning: invalid escape sequence '\.'
        expressions = "/\.+/", "/+"

it fixes this warning:
```python
    webdav3/urn.py:11: DeprecationWarning: invalid escape sequence '\.'
        expressions = "/\.+/", "/+"
```
@meshy
Copy link

meshy commented Jul 9, 2024

@azmeuk thank you for this.

This is no longer a DeprecationWarning, it's a SyntaxError.

@ezhov-evgeny would it be possible to have a release that fixes this?


UPDATE: I discovered that I was seeing a SyntaxError because pytest was configured to turn warnings into errors.

Adding the following to my pytest.ini has got this working for me, although it will raise a SyntaxError in later versions of Python:

# This was here already:
[pytest]
filterwarnings =
    error::DeprecationWarning
    # The following is new:
    ignore:invalid escape sequence '\\.':DeprecationWarning

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.

2 participants