We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dd78b9 commit dde53f6Copy full SHA for dde53f6
pycodestyle.py
@@ -1814,10 +1814,8 @@ def readlines(filename):
1814
def readlines(filename):
1815
"""Read the source code."""
1816
try:
1817
- with open(filename, 'rb') as f:
1818
- (coding, lines) = tokenize.detect_encoding(f.readline)
1819
- f = TextIOWrapper(f, coding, line_buffering=True)
1820
- return [line.decode(coding) for line in lines] + f.readlines()
+ with tokenize.open(filename) as f:
+ return f.readlines()
1821
except (LookupError, SyntaxError, UnicodeError):
1822
# Fall back if file encoding is improperly declared
1823
with open(filename, encoding='latin-1') as f:
testsuite/crlf.py
@@ -0,0 +1,3 @@
1
+'''\
2
+test
3
+'''
0 commit comments