https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
Bug ID: 69090 Summary: upload.py attempts uploads on wikis that dont allows uploads Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: enhancement Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: jayvdb@gmail.com Web browser: --- Mobile Platform: ---
Uploads are disabled on Wikidata: https://www.wikidata.org/wiki/Special:Upload
upload.py happily allows the user to attempt to upload, but then reports an APIError. If pywikibot cant detect whether uploads are enabled before upload, it should detect this APIError and provide a nice response for the user.
$ python pwb.py -family:wikidata -lang:wikidata scripts/upload.py No input filename given File or URL where image is now: blahblah.png The filename on the target wiki will default to: blahblah.png Enter a better name, or press enter to accept: The suggested description is:
Do you want to change this description? ([y]es, [N]o) y Uploading file to wikidata:wikidata via API.... Reading file blahblah.png ERROR: Upload error: Traceback (most recent call last): File "scripts/upload.py", line 216, in upload_image ignore_warnings=self.ignoreWarning) File ".../pywikibot/site.py", line 3432, in upload result = req.submit() File ".../pywikibot/data/api.py", line 418, in submit raise APIError(code, info, **result["error"]) APIError: uploaddisabled: Uploads are not enabled. Make sure $wgEnableUploads is set to true in LocalSettings.php and the PHP ini setting file_uploads is true
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |Low
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
Ricordisamoa ricordisamoa@openmailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ricordisamoa@openmailbox.or | |g Summary|upload.py attempts uploads |upload.py attempts uploads |on wikis that dont allows |on wikis that don't allow |uploads |uploads
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |70075
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
Mpaa mpaa.wiki@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mpaa.wiki@gmail.com
--- Comment #1 from Mpaa mpaa.wiki@gmail.com --- See https://gerrit.wikimedia.org/r/156465
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
Mpaa mpaa.wiki@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |PATCH_TO_REVIEW
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com Component|General |Other scripts
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |NEW
--- Comment #2 from John Mark Vandenberg jayvdb@gmail.com --- It is a bit better now, as there is no traceback, but the check and error needs to occur before asking the user a lot of questions.
$ python pwb.py upload -family:wikidata -lang:test No input filename given File or URL where image is now: https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonst... The filename on the target wiki will default to: PNG_transparency_demonstration_1.png Enter a better name, or press enter to accept: The suggested description is:
It is not possible to upload a file without a summary/description. Do you want to change this description? ([Y]es, [n]o, [q]uit) y Uploading file to wikidata:test via API.... Reading file https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonst... WARNING: API warning (tokens): action=tokens has been deprecated. Please use action=query&meta=tokens instead. ERROR: Upload error: Local file uploads are disabled on wikidata:test.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |CommodoreFabianus@gmx.de
--- Comment #3 from Fabian CommodoreFabianus@gmx.de --- We might need to be avare of bug 33731. John suggested to download the HTML Code of Special:Upload and check if the upload edit box is present.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
--- Comment #4 from Mpaa mpaa.wiki@gmail.com --- I submitted this patch. Do not why it was not logged here: https://gerrit.wikimedia.org/r/#/c/159836/
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
--- Comment #5 from Fabian CommodoreFabianus@gmx.de --- Oh nevermind. Bug 33731 is emitting not 'uploaddisabled' so it's not related to this.
https://bugzilla.wikimedia.org/show_bug.cgi?id=69090
--- Comment #6 from Andre Klapper aklapper@wikimedia.org --- (In reply to Mpaa from comment #4)
I submitted this patch. Do not why it was not logged here: https://gerrit.wikimedia.org/r/#/c/159836/
See http://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines for the required format.
pywikipedia-bugs@lists.wikimedia.org