Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,13 @@ def python_3000_invalid_escape_sequence(logical_line, tokens):
Okay: regex = r'\.png$'
W605: regex = '\.png$'
"""
if (2, 6) < sys.version_info <= (2, 7):
# NOTE(sigmavirus24): There's a bug on 2.6
# (https://bugs.python.org/issue15054) that prevents the tokenizer
# from handling bytestrings appropriately. That means this check
# produces false-positives. Instead, let's simply skip this.
return

# https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
valid = [
'\n',
Expand Down