Meno25 created this task.
Meno25 added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, alanajjar,
Aklapper.
TASK DESCRIPTION
**Steps to Reproduce: **
Run touch.py with default parameters using the following command:
python pwb.py touch.py -lang:ar -cat:"تحويلات متصلة بعنصر ويكي بيانات"
(In this case, it will run on this category: ar:تصنيف:تحويلات متصلة بعنصر
ويكي بيانات
<https://ar.wikipedia.org/wiki/%D8%AA%D8%B5%D9%86%D9%8A%D9%81:%D8%AA%D8%AD%D9%88%D9%8A%D9%84%D8%A7%D8%AA_%D9%85%D8%AA%D8%B5%D9%84%D8%A9_%D8%A8%D8%B9%D9%86%D8%B5%D8%B1_%D9%88%D9%8A%D9%83%D9%8A_%D8%A8%D9%8A%D8%A7%D9%86%D8%A7%D8%AA>)
**Actual Results:**
The script crashes with the following traceback:
python pwb.py touch.py -lang:ar -cat:"تحويلات متصلة بعنصر ويكي بيانات"
Retrieving 50 pages from wikipedia:ar.
0 pages read
0 pages written
Execution time: 11 seconds
Script terminated by exception:
ERROR: TranslationError: No English translation has been defined for
TranslateWiki key
"pywikibot-touch". It can happen due to lack of i18n submodule or
files or an outdated submodule. See
https://www.mediawiki.org/wiki/Manual:Pywikibot/i18n
Traceback (most recent call last):
File "pwb.py", line 250, in <module>
if not main():
File "pwb.py", line 243, in main
run_python_file(filename, [filename] + args, argvu, file_package)
File "pwb.py", line 95, in run_python_file
main_mod.__dict__)
File "./scripts/touch.py", line 135, in <module>
main()
File "./scripts/touch.py", line 127, in main
bot.run()
File
"/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/bot.py", line
1702, in run
super(MultipleSitesBot, self).run()
File
"/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/bot.py", line
1505, in run
self.treat(page)
File "./scripts/touch.py", line 60, in treat
page.touch(botflag=self.getOption('botflag'))
File
"/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/page.py", line
1425, in touch
summary = i18n.twtranslate(self.site, 'pywikibot-touch')
File
"/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/tools/__init__.py",
line 1738, in wrapper
return obj(*__args, **__kw)
File
"/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/i18n.py", line
756, in twtranslate
twtitle, __url__)))
pywikibot.i18n.TranslationError: No English translation has been defined
for TranslateWiki key
"pywikibot-touch". It can happen due to lack of i18n submodule or
files or an outdated submodule. See
https://www.mediawiki.org/wiki/Manual:Pywikibot/i18n
CRITICAL: Exiting due to uncaught exception <class
'pywikibot.i18n.TranslationError'>
**Notes**
Running the with the following command works as expected:
python pwb.py touch.py -purge -lang:ar -cat:"تحويلات متصلة بعنصر ويكي
بيانات"
So, the issue is only when running the script without the
> -purge
**Expected Results:**
- The script should not crash when run with default parameters.
- If the intention of the developers is to force the users to always use
//-purge//, then in this case the script should give a //Too few input
arguments// error or something like that, but I don't believe that crashing the
script is the correct behavior here. Thank you.
TASK DETAIL
https://phabricator.wikimedia.org/T223045
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Meno25
Cc: Aklapper, alanajjar, pywikibot-bugs-list, Meno25, Viztor, DannyS712, Wenyi,
Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Avicennasis, mys_721tx, jayvdb, Dalba,
Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs