Last modified: 2014-08-05 07:49:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71133, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69133 - unusedfiles raises NoPage for deleted file with a redirect
unusedfiles raises NoPage for deleted file with a redirect
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized major
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-05 01:19 UTC by John Mark Vandenberg
Modified: 2014-08-05 07:49 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description John Mark Vandenberg 2014-08-05 01:19:59 UTC
The first item on [[Special:UnusedFiles]] is currently [[File:Song_of_the_Thin_Man_(videocassette_cover_art).jpg]], which is deleted, however it has an incoming redirect which might be why it is still in unusedfiles, or perhaps a caching issue.

This causes unusedfiles to raise an exception, and there is no way to bypass it as the script only uses special:unusedfiles as a generator.

$ python pwb.py scripts/unusedfiles.py
Retrieving 50 pages from wikipedia:en.
WARNING: Http response status 404


>>> File:Song of the Thin Man (videocassette cover art).jpg <<<
Traceback (most recent call last):
  File "pwb.py", line 166, in <module>
    run_python_file(fn, argv, argvu)
  File "pwb.py", line 67, in run_python_file
    exec(compile(source, filename, "exec"), main_mod.__dict__)
  File "scripts/unusedfiles.py", line 117, in <module>
    main()
  File "scripts/unusedfiles.py", line 108, in main
    appendtext(image, u"\n\n" + template_image, always)
  File "scripts/unusedfiles.py", line 58, in appendtext
    raise pywikibot.NoPage(u"Page '%s' does not exist" % page.title())
pywikibot.exceptions.NoPage: Page Page 'File:Song of the Thin Man (videocassette cover art).jpg' does not exist doesn't exist.
<class 'pywikibot.exceptions.NoPage'>
Comment 1 Gerrit Notification Bot 2014-08-05 03:59:51 UTC
Change 151812 had a related patch set uploaded by John Vandenberg:
unusedfiles raises NoPage for deleted file

https://gerrit.wikimedia.org/r/151812
Comment 2 John Mark Vandenberg 2014-08-05 04:52:10 UTC
The 404 is because unusedfiles calls image.getImagePageHtml(), which does

GET https://en.wikipedia.org/w/index.php?title=File%3ASong_of_the_Thin_Man_%28videocassette_cover_art%29.jpg
Comment 3 John Mark Vandenberg 2014-08-05 05:38:12 UTC
bug 10153 suggests that deleted files were not included in the results, so this is probably a regression in mw.
Comment 4 Gerrit Notification Bot 2014-08-05 07:11:45 UTC
Change 151812 merged by jenkins-bot:
unusedfiles raises NoPage for deleted file

https://gerrit.wikimedia.org/r/151812

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links