Ryan10145 added a comment.

I was experimenting with the location of a test script, and I found something interesting. I used the following test script.

import sys
import pywikibot

sys.stdout.write('begin')
sys.stdout.flush()
response = pywikibot.comms.http.fetch('https://dumps.wikimedia.org/idwiki/latest/idwiki-latest-abstract.xml', stream=True)
for data in response.data.iter_content(100 * 1024):
    sys.stdout.write('asd')
    sys.stdout.flush()

When I put it in the core directory of pywikibot, the script worked as intended. As the extremely large file downloaded, the console would constantly print 'asd'.

However, when I moved this test script into the scripts folder, scripts/maintenance folder, or any other folder, the script would stop working as intended. No errors would appear, but the script would just print 'begin', and then pause, as it downloaded the extremely large file. Since the file being downloaded is large, I did not wait for the download to finish, but I believe that pywikibot.comms.http.fetch('https://dumps.wikimedia.org/idwiki/latest/idwiki-latest-abstract.xml', stream=True) breaks when not placed in the core folder.


TASK DETAIL
https://phabricator.wikimedia.org/T183664

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Ryan10145
Cc: rafidaslam, pywikibot-bugs-list, eflyjason, Aklapper, Xqt, zhuyifei1999, jayvdb, siebrand, Zoranzoki21, Framawiki, Bright1055, Toppole69, Mine0901, Jayprakash12345, Magul, Tbscho, MayS, Beeyan, Mdupont, JJMC89, MtDu, D3r1ck01, Avicennasis, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to