buriy / python-readability

fast python port of arc90's readability tool, updated to match latest readability.js!
https://github.com/buriy/python-readability
Apache License 2.0
2.67k stars 349 forks source link

Error when using positive_keywords (or negative_keywords) argument with python >= 3.7 #161

Open nbtravis opened 3 years ago

nbtravis commented 3 years ago

Got the following error:

File "/usr/local/lib/python3.8/site-packages/readability/readability.py", line 138, in __init__ self.positive_keywords = compile_pattern(positive_keywords) File "/usr/local/lib/python3.8/site-packages/readability/readability.py", line 80, in compile_pattern elif isinstance(elements, re._pattern_type): AttributeError: module 're' has no attribute '_pattern_type'

Looks like re._pattern_type has been removed in 3.7 but there's an easy fix: https://github.com/beetbox/beets/issues/2986

JackieFei commented 3 years ago

@buriy We need a new release to merge this commit : https://github.com/buriy/python-readability/commit/7f9cf4a83f51f7090e43c5ce49c84ff641bb533b, thanks.