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

W605 error while checking docstrings with regex inside it #822

Closed
smartfin opened this issue Nov 26, 2018 · 2 comments
Closed

W605 error while checking docstrings with regex inside it #822

smartfin opened this issue Nov 26, 2018 · 2 comments

Comments

@smartfin
Copy link

The bug is reproduced if you are using regex expression inside docstring with escaping of characters.

Here is example of code:

import re


def test_regex_function():
    """
    Return compiled regex of which allows to process only specific file
    paths or extensions, e.g. r"^.*\.svg$".
    :return:
    """
    return re.compile(r"^.*\.svg$")

And result of running pycodestyle 2.4.0:

pycodestyle 1.py   
                                                                                                                                                
1.py:9:-23: W605 invalid escape sequence '\.'
@FichteFoll
Copy link
Contributor

Duplicate of #795 (and fixed in master).

@sigmavirus24
Copy link
Member

Well noticed @FichteFoll

Duplicate of #795

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

No branches or pull requests

3 participants