Unverified Commit 94cb0a68 authored by Brian Norris's avatar Brian Norris Committed by Josh Boyer
Browse files

check_whence: python3/utf-8 support



WHENCE contains non-ASCII characters, so we should specify an encoding.
To get the encoding= arg in python2, we pull open from 'io' directly.
Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarJosh Boyer <jwboyer@kernel.org>
parent 7fa32bcc
#!/usr/bin/python
import os, re, sys
from io import open
def list_whence():
with open('WHENCE') as whence:
with open('WHENCE', encoding='utf-8') as whence:
for line in whence:
match = re.match(r'(?:File|Source):\s*"(.*)"', line)
if match:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment