Page MenuHomePhabricator

Problem with uploading files
Closed, ResolvedPublic

Description

Author: massari.fen

Description:
Getting:
ERROR: Upload error:
Traceback (most recent call last):

File "scripts/upload.py", line 214, in upload_image
  ignore_warnings=self.ignoreWarning)
File "/root/mybot/core/pywikibot/site.py", line 3246, in upload
  raise ValueError("APISite.upload: cannot upload file without "

ValueError: APISite.upload: cannot upload file without a summary/description.

Even with -noverify I get the same error. And if I try to change the desc I get: Could not load GUI modules: No module named gui and the error from above!


Version: core-(2.0)
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=68645

Details

Reference
bz60042

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:53 AM
bzimport set Reference to bz60042.
bzimport added a subscriber: Unknown Object (????).

Neither there is a standard module gui nor an external library is included in the framework.

Regarding gui, that is bug 68645. You can set 'editor=vi' in your config to work around that bug, or 'editor=notepad' for Windows users :P.

It definitely needs to provide a nicer set of errors. If Site.upload() requires a summary, then upload.py should get one from the user before calling Site.upload()

$ 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
Could not load GUI modules: No module named gui
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 3399, in upload
  raise ValueError("APISite.upload: cannot upload file without "

ValueError: APISite.upload: cannot upload file without a summary/description.