Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Fail to download any images on Python 3.7 #25

Closed
tvonradio opened this issue Jul 23, 2018 · 4 comments
Closed

Fail to download any images on Python 3.7 #25

tvonradio opened this issue Jul 23, 2018 · 4 comments

Comments

@tvonradio
Copy link

I'm using dagr.py v0.64 with robobrowser 0.5.3 on Python 3.7.0- amd64 on Windows 10 Home 1803. The script starts up fine, but comes up with the following errors and fails to download any images. Username and password redacted.

$ dagr.py -u username -p password -mgsv Quentinvcastel
dagr.py v0.64 - deviantArt gallery ripper
Current deviant: Quentinvcastel
Ripping Quentinvcastel's gallery...
Quentinvcastel's gallery page 1 crawled...
Quentinvcastel's gallery page 2 crawled...
Quentinvcastel's gallery page 3 crawled...
Quentinvcastel's gallery page 4 crawled...
Quentinvcastel's gallery page 5 crawled...
Total deviations in Quentinvcastel's gallery found: 114
Downloading 1 of 114 ( https://www.deviantart.com/quentinvcastel/art/Saint-Exupery-528691228 )
Traceback (most recent call last):
File "C:\Users\Main\AppData\Local\Programs\Python\Python37\Scripts\dagr.py", line 4, in
import('pkg_resources').run_script('dagr==0.64', 'dagr.py')
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\pkg_resources_init_.py", line 658, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\pkg_resources_init_.py", line 1445, in run_script
exec(script_code, namespace, namespace)
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\dagr-0.64-py3.7.egg\EGG-INFO\scripts\dagr.py", line 591, in
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\dagr-0.64-py3.7.egg\EGG-INFO\scripts\dagr.py", line 574, in main
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\dagr-0.64-py3.7.egg\EGG-INFO\scripts\dagr.py", line 285, in deviant_get
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\dagr-0.64-py3.7.egg\EGG-INFO\scripts\dagr.py", line 151, in find_link
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\robobrowser-0.5.3-py3.7.egg\robobrowser\browser.py", line 269, in get_link
self.parsed, _link_ptn, text=text, *args, **kwargs
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\robobrowser-0.5.3-py3.7.egg\robobrowser\helpers.py", line 51, in find
soup, name, attrs or {}, recursive, text, 1, **kwargs
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\robobrowser-0.5.3-py3.7.egg\robobrowser\helpers.py", line 39, in find_all
if match_text(text, tag):
File "c:\users\Main\appdata\local\programs\python\python37\lib\site-packages\robobrowser-0.5.3-py3.7.egg\robobrowser\helpers.py", line 16, in match_text
if isinstance(text, re._pattern_type):
AttributeError: module 're' has no attribute '_pattern_type'

@voyageur voyageur changed the title Script fails to download any images Fail to download any images on Python 3.7 Jul 23, 2018
@voyageur
Copy link
Owner

Thanks for the report, looks like this is jmcarp/robobrowser#87

I do not have a python 3.7 setup around to test, can you try adding "re._pattern_type = re.Pattern" in set_browser()? Before the main RoboBrowser call. That is an ugly workaround though, but robobrowser is mostly dead (I should just switch to plain requests/beautifulsoup one day)

@tvonradio
Copy link
Author

Thanks! I tried adding that, but it brings up the following error. I also tried adding the quotes, but it produces the same error. I will try downgrading my Python installation.

File "C:\Users\Main\Downloads\dagr\dagr\dagr.py", line 92
def set_browser(re._pattern_type = re.Pattern):
^
SyntaxError: invalid syntax

@tvonradio
Copy link
Author

Thanks again, and I can confirm this is only an issue in Python 3.7.0. I downgraded to 3.6.6 and it works fine.

@voyageur
Copy link
Owner

No problem! Thanks for confirming python 3.7 is the root cause

I will push a workaround that should support it (quickly tested with a 3.7 virtualenv), until I can think of a proper long-term fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants