Alir3z4 / html2text

Convert HTML to Markdown-formatted text.
alir3z4.github.io/html2text/
GNU General Public License v3.0
1.79k stars 273 forks source link

AttributeError: 'str' object has no attribute 'decode' #304

Closed sergiomb2 closed 4 years ago

sergiomb2 commented 4 years ago

Ends with :

Traceback (most recent call last):
File "/usr/bin/python3-html2text", line 11, in <module>
load_entry_point('html2text==2019.8.11', 'console_scripts', 'html2text')()
File "/usr/lib/python3.7/site-packages/html2text/cli.py", line 262, in main
data = data.decode(args.encoding, args.decode_errors)
AttributeError: 'str' object has no attribute 'decode'
sergiomb2 commented 4 years ago

I remembered, I read that with python 2 it worked . [1] works

[1] wget --quiet -O - https://downloads.openwrt.org/snapshots/faillogs/x86_64/packages/ | /usr/bin/python2-html2text

jdufresne commented 4 years ago

This was fixed in version 2019.9.26. Can you test with that version or master and report?

I verified that this does fail with 2019.8.11, but not with the newer release.

Duplicate #287

sergiomb2 commented 4 years ago

One question is just for curiosity , why 2019.9.26 is not a release is just one tag ? I think I miss the update by this reason ( be just a tag not a release)

Thanks

jdufresne commented 4 years ago

It is a release. Here is the PyPI release page: https://pypi.org/project/html2text/2019.9.26/

When I install html2text with pip, it installs version 2019.9.26:

$ python3 -m venv venv
$ ./venv/bin/pip install html2text
Collecting html2text
  Using cached https://files.pythonhosted.org/packages/49/21/eb38d335ab15fc13564a5e971c1403707fb3a037292f246fa82e17208794/html2text-2019.9.26-py3-none-any.whl
Installing collected packages: html2text
Successfully installed html2text-2019.9.26