Skip to content

Commit ae1d4b6

Browse files
authored
Fix Windows parsing bugs
Fixes #40 Signed-off-by: Daniel Lenski <dlenski@gmail.com>
1 parent 6e5c897 commit ae1d4b6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

zxing/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def decode(self, filenames, try_harder=False, possible_formats=None, pure_barcod
147147

148148
file_results = []
149149
for line in stdout.splitlines(True):
150-
if line.startswith((b'file:///', b'Exception')):
150+
if line.startswith((b'file://', b'Exception')):
151151
file_results.append(line)
152152
else:
153153
file_results[-1] += line
@@ -180,7 +180,7 @@ def parse(cls, zxing_output):
180180

181181
for l in zxing_output.splitlines(True):
182182
if block == CLROutputBlock.UNKNOWN:
183-
if l.endswith(b': No barcode found\n'):
183+
if l.strip().endswith(b': No barcode found'):
184184
return cls(l.rsplit(b':', 1)[0].decode(), None, None, None, None, None)
185185
m = re.match(rb"(\S+) \(format:\s*([^,]+),\s*type:\s*([^)]+)\)", l)
186186
if m:

0 commit comments

Comments
 (0)