Fix trailing whitespace segment on Python 3.

Using str() on a bytestring produces the repr on Python 3, not some
implicitly decoded string. So cast a literal instead.

Fixes #1613.
This commit is contained in:
Elliott Sales de Andrade 2016-07-06 19:20:31 -04:00
parent d816de054a
commit ed69b983b2

View File

@ -578,7 +578,7 @@ def trailing_whitespace(pl, segment_info):
else:
buf = segment_info['buffer']
bws = b' \t'
sws = str(bws)
sws = str(' \t') # Ignore unicode_literals and use native str.
for i in range(len(buf)):
try:
line = buf[i]