ERROR extracting message
Traceback (most recent call last):
File "C:\Users\dtr\Source\Repos\talon\talon\quotations.py", line 212, in extract_from
return extract_from_html(msg_body)
File "C:\Users\dtr\Source\Repos\talon\talon\quotations.py", line 429, in extract_from_html
result = _extract_from_html(msg_body)
File "C:\Users\dtr\Source\Repos\talon\talon\quotations.py", line 460, in _extract_from_html
msg_body = re.sub(r"\<\?xml.+\?>|\<!DOCTYPE.+]>", "", msg_body)
File "C:\Users\dtr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\regex\regex.py", line 276, in sub
endpos, concurrent, timeout)
TypeError: cannot use a string pattern on a bytes-like object
Environment is Python 3.7 32-Bit.
Error occurs when calling either
quotations.extract_from(html, 'text/html')
or
quotations.extract_from_html(html)
Same issue accountered. Python 3.6.4::Anaconda,Inc
Googled it may some input encode issue,since I copied this paragraph from the website as the content of html.
ERROR extracting message Traceback (most recent call last): File "C:\Users\dtr\Source\Repos\talon\talon\quotations.py", line 212, in extract_from return extract_from_html(msg_body) File "C:\Users\dtr\Source\Repos\talon\talon\quotations.py", line 429, in extract_from_html result = _extract_from_html(msg_body) File "C:\Users\dtr\Source\Repos\talon\talon\quotations.py", line 460, in _extract_from_html msg_body = re.sub(r"\<\?xml.+\?>|\<!DOCTYPE.+]>", "", msg_body) File "C:\Users\dtr\AppData\Local\Programs\Python\Python37-32\lib\site-packages\regex\regex.py", line 276, in sub endpos, concurrent, timeout) TypeError: cannot use a string pattern on a bytes-like object
Environment is Python 3.7 32-Bit.
Error occurs when calling either quotations.extract_from(html, 'text/html') or quotations.extract_from_html(html)
as the example.