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 bug, 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

AbdealiJK added a subscriber: Mpaa.Sep 25 2016, 4:53 PM

@Mpaa while I understand that you could solve this task in less than a minute, it would be useful to leave these good first bug 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

Ankit_Raj_ojha added a subscriber: JameerBabu.
Ankit_Raj_ojha removed Ankit_Raj_ojha as the assignee of this task.Oct 5 2016, 7:41 AM
Ankit_Raj_ojha added a subscriber: Ankit_Raj_ojha.

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

OdysseasKr added a subscriber: Xqt.Oct 17 2016, 6:53 PM

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

Xqt added a comment.Nov 5 2016, 9:53 AM

@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.

Xqt closed this task as Resolved.Nov 6 2016, 10:35 AM

Change 316060 merged by jenkins-bot:
Silence warnings

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

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