Hello,
I have a script which should add a template to articles which are created
by the ContentTranslation tool (the template has parameters which depends
on language and revision which were used as the source one; this is the
reason why I use separate script). It may be found at
https://github.com/urbanecm/addPrekladCT/blob/master/addmissing.py. The
script work perfectly on my local PC and on bastion host but I can't get it
work on the grid.
The script itself is run by *python3 addmissing.py -always -file:pages.txt
-search:'-insource:/\{\{[Pp]řeklad/'* and require pages.txt file and
preklads.txt file at https://tools.wmflabs.org/urbanecmbot/test/preklads.txt.
The first contains pages that should be processed and act as the generator,
the second one is something like a database with exact templates which
should be inserted. Both files are as an example in the attachments.
When I try to run it at toollabs bastion, all works as it should. When I
send the script to grid, it do not work (see sample output below). Why? Can
somebody help me with it?
Thank you in advance,
Martin Urbanec / Urbanecm
; Output
urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
$ cat test.sh
python3 addmissing.py -always -file:pages.txt
-search:'-insource:/\{\{[Pp]řeklad/'
urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
$ jsub bash test.sh
Your job 6201363 ("bash") has been submitted
urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
$ qstat
job-ID prior name user state submit/start at queue
slots ja-task-ID
-----------------------------------------------------------------------------------------------------------------
6201363 0.30000 bash urbanecm r 06/16/2017 18:14:42
[email protected] 1
urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
$ ls ~/bash.*
/home/urbanecm/bash.err /home/urbanecm/bash.out
urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
$ cat ~/bash.*
Traceback (most recent call last):
File "addmissing.py", line 223, in <module>
main()
File "addmissing.py", line 183, in main
local_args = pywikibot.handle_args(args)
File "/shared/pywikipedia/core/pywikibot/bot.py", line 954, in handle_args
writeToCommandLogFile()
File "/shared/pywikipedia/core/pywikibot/bot.py", line 1128, in
writeToCommandLogFile
command_log_file.write(s + os.linesep)
File "/usr/lib/python3.4/codecs.py", line 711, in write
return self.writer.write(data)
File "/usr/lib/python3.4/codecs.py", line 368, in write
data, consumed = self.encode(object, self.errors)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc5' in
position 67: surrogates not allowed
CRITICAL: Closing network session.
<class 'UnicodeEncodeError'>
urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT
$
Adriano_Banchieri
American_Gods_(seriál)
Battle_of_San_Patricio
Black_Panther_(film)
Budj_Bim
Äeské_BudÄjovice_jižnÃ_zastávka
Äesko-nÄmecká_obchodnÃ_a_průmyslová_komora
Cockatoo_Island_(New_South_Wales)
DÄrovánÃ_(sÃÅ¥ovánÃ)
Euroregion_KruÅ¡nohoÅÃ
Fotbalová_federace_Austrálie
Gabriel_Harrison
Heritage_Foundation
HnutÃ_BDS
Hodinový_takt
Jan_Christian_Smuts
Joseph_Ray_Watkins
Kingston_a_historická_oblast_Arthurova_údolÃ
KuÄum_Chán
LetiÅ¡tÄ_Jásira_Arafata
Litovel_mÄsto
Litovel_pÅedmÄstÃ
Litovel_(železniÄnÃ_stanice)
Logan_Paul
Makronky
Manfred_Weber
Mark_Billingham
Marla_Maplesová
Meizu
MezinárodnÃ_letiÅ¡tÄ_El-ArÃÅ¡
MiláÄek_(kniha)
NárodnÃ_fotbalová_asociace_Bruneje
NárodnÃ_park_Prince_Regent
Oblast_Modrých_hor
Operace_Tractable
Oscar_Hertwig
Oxandrolon
ProgramovacÃ_konvence
Randomizace
Riverland
Ruggero_Pasquarelli
RYB
Seznam_dÃlů_seriálu_ZmÄna_hry
Softwarová_kompatibilita
Soy_Luna_en_Concierto
Spider-Man:_Homecoming
Sputnik_1_testovacÃ_EMC/EMI_model_(Lab_model)
Start_Linuxového_systému
Statek_Brickendon
Stephen_Marley
Suché_utonutÃ
Swish_Swish
Theodor_Boveri
Velká_pÃseÄná_biosférická_rezervace_(Queensland)
Velká_severnÃ_silnice
Vue.js
Wiring_(programovacÃ_jazyk)
Witness_(album,_Katy_Perry)
Yeol_Eum_Son
ZasÃlánÃ_zpráv
Battle_of_San_Patricio {{PÅeklad|en|Battle of San Patricio|681532466}}
Makronky {{PÅeklad|en|Macaron|702131015}}
Stephen_Marley {{PÅeklad|en|Stephen Marley (musician)|705380410}}
Jan_Christian_Smuts {{PÅeklad|en|Jan Smuts|711517191}}
Heritage_Foundation {{PÅeklad|en|The Heritage Foundation|723858589}}
Start_Linuxového_systému {{PÅeklad|en|Linux startup process|725173832}}
Wiring_(programovacÃ_jazyk) {{PÅeklad|en|Wiring (development
platform)|725553256}}
Softwarová_kompatibilita {{PÅeklad|en|Computer compatibility|757991444}}
Oxandrolon {{PÅeklad|en|Oxandrolone|770272159}}
Oblast_Modrých_hor {{PÅeklad|en|Greater Blue Mountains Area|777907499}}
Spider-Man:_Homecoming {{PÅeklad|en|Spider-Man: Homecoming|779025675}}
NárodnÃ_park_Prince_Regent {{PÅeklad|en|Prince Regent National
Park|747941313}}
Black_Panther_(film) {{PÅeklad|en|Black Panther (film)|778690277}}
Riverland {{PÅeklad|en|Riverland|778280932}}
Euroregion_KruÅ¡nohoÅà {{PÅeklad|de|Euroregion
Erzgebirge/KruÅ¡nohoÅÃ|160011488}}
Ruggero_Pasquarelli {{PÅeklad|en|Ruggero Pasquarelli|776641372}}
Fotbalová_federace_Austrálie {{PÅeklad|en|Football Federation
Australia|778471740}}
Manfred_Weber {{PÅeklad|en|Manfred Weber|773823243}}
Seznam_dÃlů_seriálu_ZmÄna_hry {{PÅeklad|en|List of Game Shakers
episodes|779235973}}
Cockatoo_Island_(New_South_Wales) {{PÅeklad|en|Cockatoo Island (New
South Wales)|772762258}}
Theodor_Boveri {{PÅeklad|en|Theodor Boveri|731167145}}
Velká_severnÃ_silnice {{PÅeklad|en|Great North Road (New South
Wales)|779036898}}
Oscar_Hertwig {{PÅeklad|en|Oscar Hertwig|765120544}}
MiláÄek_(kniha) {{PÅeklad|en|Bel Ami|774014758}}
Äeské_BudÄjovice_jižnÃ_zastávka {{PÅeklad|pl|Äeské BudÄjovice
jižnà zastávka|43790544}}
Kingston_a_historická_oblast_Arthurova_údolà {{PÅeklad|en|Kingston and
Arthurs Vale Historic Area|778993100}}
Statek_Brickendon {{PÅeklad|en|Brickendon Estate|753926846}}
Randomizace {{PÅeklad|en|Randomization|753715368}}
LetiÅ¡tÄ_Jásira_Arafata {{PÅeklad|en|Yasser Arafat International
Airport|756644759}}
Hodinový_takt {{PÅeklad|en|Clock rate|758946117}}
Velká_pÃseÄná_biosférická_rezervace_(Queensland) {{PÅeklad|en|Great
Sandy Biosphere Reserve|777707884}}
DÄrovánÃ_(sÃÅ¥ovánÃ) {{PÅeklad|en|Hole punching
(networking)|773733206}}
MezinárodnÃ_letiÅ¡tÄ_El-ArÃÅ¡ {{PÅeklad|en|El Arish International
Airport|774672243}}
Budj_Bim {{PÅeklad|en|Budj Bim|685859081}}
HnutÃ_BDS {{PÅeklad|en|Boycott, Divestment and Sanctions|780767835}}
NárodnÃ_fotbalová_asociace_Bruneje {{PÅeklad|en|National Football
Association of Brunei Darussalam|777646600}}
Swish_Swish {{PÅeklad|en|Swish Swish|781503771}}
RYB {{PÅeklad|en|RYB color model|772871895}}
Yeol_Eum_Son {{PÅeklad|en|Yeol Eum Son|782541976}}
Meizu {{PÅeklad|en|Meizu|782839570}}
Äesko-nÄmecká_obchodnÃ_a_průmyslová_komora
{{PÅeklad|de|Deutsch-Tschechische Industrie- und Handelskammer|165961797}}
Logan_Paul {{PÅeklad|en|Logan Paul|782365881}}
Soy_Luna_en_Concierto {{PÅeklad|es|Soy Luna en Concierto|99504022}}
Marla_Maplesová {{PÅeklad|pl|Marla Maples|47597326}}
Joseph_Ray_Watkins {{PÅeklad|en|Joseph Ray Watkins|783810519}}
Mark_Billingham {{PÅeklad|en|Mark Billingham|783571534}}
Gabriel_Harrison {{PÅeklad|en|Gabriel Harrison|765759661}}
Witness_(album,_Katy_Perry) {{PÅeklad|en|Witness (Katy Perry
album)|784658913}}
Litovel_pÅedmÄstà {{PÅeklad|pl|Litovel pÅedmÄstÃ|43790723}}
Litovel_mÄsto {{PÅeklad|pl|Litovel mÄsto|43789970}}
Litovel_(železniÄnÃ_stanice) {{PÅeklad|pl|Litovel (stacja
kolejowa)|43790688}}
Operace_Tractable {{PÅeklad|en|Operation Tractable|776161271}}
KuÄum_Chán {{PÅeklad|en|Kuchum|772292543}}
Sputnik_1_testovacÃ_EMC/EMI_model_(Lab_model) {{PÅeklad|en|SPUTNIK-1 EMC/EMI
LAB MODEL|785086415}}
American_Gods_(seriál) {{PÅeklad|sk|American Gods|6511423}}
ProgramovacÃ_konvence {{PÅeklad|en|Coding conventions|784452346}}
ZasÃlánÃ_zpráv {{PÅeklad|en|Message passing|779896367}}
Vue.js {{PÅeklad|en|Vue.js|784427134}}
Suché_utonutà {{PÅeklad|en|Dry drowning|785445566}}
Adriano_Banchieri {{PÅeklad|en|Adriano Banchieri|742695954}}
_______________________________________________
Labs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/labs-l