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
t...@tools-exec-1404.eqiad.wmf     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
Labs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/labs-l

Reply via email to