New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent mechanize update breaks script #218

Closed
HellcatAisha opened this Issue Mar 31, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@HellcatAisha

HellcatAisha commented Mar 31, 2017

PixivDownloader2 version 20170220
https://github.com/Nandaka/PixivUtil2/releases
Donate at https://bit.ly/PixivUtilDonation
Reading /opt/pixiv-downloader-20170220/config.ini ...
done.
Traceback (most recent call last):
  File "PixivUtil2.py", line 1902, in <module>
    main()
  File "PixivUtil2.py", line 1779, in main
    __br__ = PixivBrowserFactory.getBrowser(config=__config__)
  File "/opt/pixiv-downloader-20170220/PixivBrowserFactory.py", line 515, in getBrowser
    _browser = PixivBrowser(defaultConfig, defaultCookieJar)
  File "/opt/pixiv-downloader-20170220/PixivBrowserFactory.py", line 35, in __init__
    mechanize.Browser.__init__(self, factory=mechanize.RobustFactory())
AttributeError: 'module' object has no attribute 'RobustFactory'

The script fails to start as per the error above. Tested with a fresh repository clone.

I run a Linux system and looking through my update log, I see that mechanize was recently updated from 0.2.5 to 0.3.1. Downgrading this package enabled the script to start up and log me in again. Haven't had a chance to test if the script can successfully download something after downgrading; there were a few other dependencies which recently received minor updates as well (numpy and imageio spring to mind).

Edit: Downloading still works after downgrading mechanize, so it's just mechanize that's the problem.

@Nandaka

This comment has been minimized.

Owner

Nandaka commented Apr 5, 2017

From their github:

Yes, as per the Changelog, mechanize.Browser does not accept the factory argument anymore. All HTML parsing is done using html5lib.

If you are using v3.x, you need to manually remove the factory parameter from https://github.com/Nandaka/PixivUtil2/blob/master/PixivBrowserFactory.py#L35

I need to check the compatibiliy before I've update the libs.

@Nandaka Nandaka added the Enhancement label Apr 5, 2017

@Nandaka Nandaka closed this in 6b610c5 Apr 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment