kompress.kopen improvements
- tests - uniform handling for bytes/str, always return utf8 str by default
This commit is contained in:
parent
c3a77b6256
commit
8b8a85e8c3
7 changed files with 52 additions and 24 deletions
|
@ -136,7 +136,6 @@ def read_html(tpath: Path, file: str) -> Iterable[Parsed]:
|
|||
results.append((dt, url, title))
|
||||
parser = TakeoutHTMLParser(callback=cb)
|
||||
with kopen(tpath, file) as fo:
|
||||
# TODO careful, wht if it's a string already? make asutf method?
|
||||
data = fo.read().decode('utf8')
|
||||
data = fo.read()
|
||||
parser.feed(data)
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue