Page MenuHomePhabricator

Convert imagecopy.py to requests
Closed, ResolvedPublic

Description

The file imagecopy.py uses urllib/urllib2.urlopen. It should use requests.

Details: T68102

Event Timeline

jayvdb created this task.Mar 21 2016, 11:39 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 21 2016, 11:39 AM
MtDu added a subscriber: MtDu.Jul 22 2016, 2:14 PM

Porting this over to requests should be no problem. However, I don't think there is a replacement for the urlencode that is used on line 271. Is it ok to leave that urllib/urlencode usage?

MtDu added a comment.Jul 29 2016, 12:25 AM

@jayvdb
Please see message above.

@MtDu @Framawiki , status of this one? Could be a good GCI task?

@MtDu @Framawiki , status of this one? Could be a good GCI task?

Yes !

Aklapper updated the task description. (Show Details)Dec 18 2017, 11:14 AM

I tried to improve / clarify the task description but someone please double-check. Thanks!

Dvorapa updated the task description. (Show Details)Dec 18 2017, 2:03 PM
eflyjason added subscribers: Xqt, eflyjason.EditedDec 21 2017, 11:16 AM

Just curious, @Xqt suggests here in another patch that pywikibot.comms.http could be used instead of requests. Would pywikibot.comms.http be better here too?

Dvorapa added a subscriber: Dvorapa.EditedDec 21 2017, 6:22 PM

@eflyjason pywikibot.comms.http is literally just requests wrapped into a pywikibot class with some modified features tailored to pywikibot needs. If the feature is supported by pywikibot.comms.http, then it is recommended to use primarily this. If not, then there is no other possibility than import requests and use that (or implement the missing feature into pywikibot.comms.http of course :) ).

Whatever approach is agreed on, feel free to edit the task desc so a task desc which is not just one sentence would be available to GCI students. Thanks :)

Dvorapa added a comment.EditedDec 24 2017, 11:58 AM

@Aklapper Generally this is just a subtask of T68102. Everything is already written in the description of T68102, I would only duplicate its description here, which does not seem necessary to me

eflyjason updated the task description. (Show Details)Dec 24 2017, 12:00 PM

Change 402591 had a related patch set uploaded (by Rafidaslam; owner: rafid):
[pywikibot/core@master] imagecopy: Convert to use requests

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

Dvorapa removed a subscriber: Dvorapa.Jan 6 2018, 5:53 PM
jayvdb reassigned this task from jayvdb to rafidaslam.Jan 7 2018, 2:19 AM
jayvdb added a comment.Jan 7 2018, 2:22 AM

It is always required to use pywikibot.comms , because those 'features' are described in our documentation, and it is messy to need to document that the features only work sometimes.

jayvdb added a comment.Jan 7 2018, 2:24 AM

There are also requests and urllib3 workarounds in pywikibot.comms.

Change 402591 merged by jenkins-bot:
[pywikibot/core@master] imagecopy: Convert to use pywikibot.comms.http.fetch

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

Framawiki closed this task as Resolved.Jan 7 2018, 6:04 PM