Page MenuHomePhabricator

Pywikibot Script image.py Site warnings
Closed, ResolvedPublic

Description

It is confusing for users when the pywikibot.Bot gives warnings about self._site not being set. Currently in image.py it gives:

>pwb.py image "Senior picture.jpg"
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: meta:meta
Retrieving 1 pages from meta:meta.
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: meta:meta

This can be simplified by just setting self.site in the constructor of the Bot class being used by image.py

Marking as good first task, as it's simple to do and would be beneficial for new contributors.

Event Timeline

Change 312742 had a related patch set uploaded (by Mpaa):
image.py: avoid 'site not set' warning

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

@Mpaa while I understand that you could solve this task in less than a minute, it would be useful to leave these good first task tasks for people who would like to begin contributing to pywikibot. Especially something like this low priority, easy task.

Otherwise it's difficult to get someone initiated to pywikibot bug solving. And they can learn git, gerrit, and the Wikimedia basics with these.

Change 312742 abandoned by Mpaa:
image.py: avoid 'site not set' warning

Reason:
See bug comments.

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

Change 316060 had a related patch set uploaded (by OdysseasKr):
Silence warnings

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

Change 316071 had a related patch set uploaded (by OdysseasKr):
Move self.site setting to Bot constructor

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

Change 316071 abandoned by Xqt:
Move self.site setting to Bot constructor

Reason:
See I60f757a92818

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

Sorry for the too many commits, I'm trying to get familiar with the contribution process. Many thanks to @Xqt for the tips.

Xqt triaged this task as Low priority.Oct 30 2016, 11:41 AM

Change 319842 had a related patch set uploaded (by Jameer):
Modifying image.py

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

Change 319858 had a related patch set uploaded (by Jameer):
Modified image.py To avoid site warnings.

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

@JameerBabu: It is really confusing. Could you please amend your commit instead of committing a few set of them. I don't know which is the actual one and which should be abandoned. And there is another patch already submitted by @OdysseasKr. Need your help in this matter.

Change 319858 abandoned by Xqt:
Modified image.py To avoid site warnings.

Reason:
patch I60f757a92 already merged

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

Change 319842 abandoned by Xqt:
Modifying image.py

Reason:
patch I60f757a92 already merged

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