From 2f02fbcd726d680de0782ded9bcc329bd6c33162 Mon Sep 17 00:00:00 2001 From: Bernard Cafarelli Date: Tue, 24 Jul 2018 14:06:04 +0200 Subject: [PATCH] Workaround robobrowser bug to support Python 3.7, fix #25 --- CHANGELOG.md | 1 + dagr/dagr.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62aa7ba..3eb3dcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ #### TBD - Update to new base URL, fix #24 - Repair and rewrite group crawling +- Workaround robobrowser bug for Python 3.7, fix #25 ## [0.63] (https://github.com/voyageur/dagr/tree/0.63) #### 02/01/2018 diff --git a/dagr/dagr.py b/dagr/dagr.py index ff13652..85051c6 100755 --- a/dagr/dagr.py +++ b/dagr/dagr.py @@ -117,6 +117,9 @@ def set_browser(self): parser = "lxml" except ImportError: parser = "html.parser" + # Workaround robobrowser bug https://github.com/jmcarp/robobrowser/issues/87 + if sys.version_info>=(3,5): + re._pattern_type = re.Pattern self.browser = RoboBrowser(history=False, session=session, tries=3, user_agent=choice(user_agents),