Last modified: 2014-11-01 05:14:27 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 T72494, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70494 - fileIsShared fails on Wikimedia site linked to Commons
fileIsShared fails on Wikimedia site linked to Commons
Status: REOPENED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: John Mark Vandenberg
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-06 15:47 UTC by Merlijn van Deen (test)
Modified: 2014-11-01 05:14 UTC (History)
3 users (show)

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


Attachments

Description Merlijn van Deen (test) 2014-09-06 15:47:18 UTC
The following snippet:

import pywikibot
itwp = pywikibot.Site('it', 'wikipedia')
title = 'File:Sepp Maier 1.JPG'
pywikibot.ImagePage(itwp, title).fileIsShared()

should return True. However, after https://github.com/wikimedia/pywikibot-core/commit/faf69ed5281c8da06f155711777bbea67d92f00a#diff-6db52cb863a71de75beda6cf2e90e235R1825, it now raises

>>> pywikibot.ImagePage(itwp, title).fileIsShared()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/valhallasw/src/pywikibot-core/pywikibot/page.py", line 1864, in fileIsShared
    raise pywikibot.NoPage(self)
pywikibot.exceptions.NoPage: Page [[it:File:Sepp Maier 1.JPG]] doesn't exist.
Comment 1 Gerrit Notification Bot 2014-09-07 08:29:41 UTC
Change 158921 had a related patch set uploaded by John Vandenberg:
fileIsShared fails on sites with shared file repo

https://gerrit.wikimedia.org/r/158921
Comment 2 Gerrit Notification Bot 2014-09-07 17:27:23 UTC
Change 158921 merged by jenkins-bot:
fileIsShared fails on sites with shared file repo

https://gerrit.wikimedia.org/r/158921
Comment 3 John Mark Vandenberg 2014-09-07 23:44:24 UTC
That fixed 'itwp.fileIsShared' for a shared file.

However should 'commons.fileIsShared' for a non-local file return False instead of raise NoPage?
Comment 4 Merlijn van Deen (test) 2014-09-08 07:58:36 UTC
on itwiki, it should:

* return False if the file is local,
* return True if the file is on commons, and
* raise NoPage if the file doesn't exist at all


What's the point of fileIsShared otherwise?
Comment 5 John Mark Vandenberg 2014-09-08 08:03:04 UTC
I believe it now does all of those (itwiki) that after the previous commit.

Clarifying my question:

On commonswiki, with the FilePage with a title that is *only* on itwp, should it
a) return False, or
b) raise NoPage
Comment 6 John Mark Vandenberg 2014-11-01 05:14:27 UTC
@Merlijn van Deen are you happy with the current implementation?

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


Navigation
Links