Read the search replace patterns file differently

Might fix patterns not being recognized on windows
This commit is contained in:
Kovid Goyal 2017-06-12 20:58:12 +05:30
parent 495bece5e8
commit 1d945ced65
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -331,14 +331,12 @@ def abspath(x):
def read_sr_patterns(path, log=None):
import json, re, codecs
import json, re
pats = []
with codecs.open(path, 'r', 'utf-8') as f:
with open(path, 'rb') as f:
lines = f.read().decode('utf-8').splitlines()
pat = None
for line in f.readlines():
if line.endswith(u'\n'):
line = line[:-1]
for line in lines:
if pat is None:
if not line.strip():
continue