Make encoding independend from environment by enforcing ascii.
And ignore decoding errors (i.e. bytes with code greater 127)
due to they are not essential for whitespace validation.
Components: Framework
VK-GL-CTS issue: 1665
Change-Id: I140ed7ff520c651d38d53ff1a99665242c71d54b
from common import getChangedFiles, getAllProjectFiles, isTextFile
def checkFileWhitespace (file):
- f = open(file, 'rt')
+ if (sys.version_info < (3, 0)):
+ f = open(file, 'rt')
+ else:
+ f = open(file, 'rt', encoding="ascii", errors='replace')
error = False
for lineNum, line in enumerate(f):
if line.endswith(" \n") or line.endswith("\t\n"):