python3-only version 2019.9.26, working
This commit is contained in:
parent
edaba3eb30
commit
a436fdae76
2 changed files with 25 additions and 2 deletions
21
python3-string-encoding.patch
Normal file
21
python3-string-encoding.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
--- html2text-2019.9.26/html2text/cli.py.orig 2020-12-04 21:03:13.896696602 +0100
|
||||
+++ html2text-2019.9.26/html2text/cli.py 2020-12-06 01:29:03.649034019 +0100
|
||||
@@ -260,6 +260,8 @@
|
||||
|
||||
try:
|
||||
data = data.decode(args.encoding, args.decode_errors)
|
||||
+ except AttributeError:
|
||||
+ pass
|
||||
except UnicodeDecodeError as err:
|
||||
warning = bcolors.WARNING + "Warning:" + bcolors.ENDC
|
||||
warning += " Use the " + bcolors.OKGREEN
|
||||
@@ -303,4 +305,8 @@
|
||||
h.open_quote = args.open_quote
|
||||
h.close_quote = args.close_quote
|
||||
|
||||
- sys.stdout.write(h.handle(data))
|
||||
+ handled_data = h.handle(data)
|
||||
+ try:
|
||||
+ sys.stdout.write(handled_data)
|
||||
+ except UnicodeEncodeError:
|
||||
+ sys.stdout.buffer.write(handled_data.encode('utf-8'))
|
||||
Loading…
Add table
Add a link
Reference in a new issue