<div dir="ltr">Hello, <div><br></div><div>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 <a href="https://github.com/urbanecm/addPrekladCT/blob/master/addmissing.py" target="_blank">https://github.com/urbanecm/addPrekladCT/blob/master/addmissing.py</a>. The script work perfectly on my local PC and on bastion host but I can't get it work on the grid. </div><div><br></div><div>The script itself is run by <i>python3 addmissing.py -always -file:pages.txt -search:'-insource:/\{\{[Pp]řeklad/'</i> and require pages.txt file and preklads.txt file at <a href="https://tools.wmflabs.org/urbanecmbot/test/preklads.txt" target="_blank">https://tools.wmflabs.org/urbanecmbot/test/preklads.txt</a>. 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. </div><div><br></div><div>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? </div><div><br></div><div>Thank you in advance, </div><div>Martin Urbanec / Urbanecm</div><div><br></div><div>; Output</div><div><br></div><div><div>urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT </div><div>$ cat test.sh </div><div>python3 addmissing.py -always -file:pages.txt -search:'-insource:/\{\{[Pp]řeklad/'</div><div>urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT </div><div>$ jsub bash test.sh</div><div>Your job 6201363 ("bash") has been submitted</div><div>urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT </div><div>$ qstat</div><div>job-ID  prior   name       user         state submit/start at     queue                          slots ja-task-ID </div><div>-----------------------------------------------------------------------------------------------------------------</div><div>6201363 0.30000 bash       urbanecm     r     06/16/2017 18:14:42 task@tools-exec-1404.eqiad.wmf     1        </div><div>urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT </div><div>$ ls ~/bash.*</div><div>/home/urbanecm/bash.err  /home/urbanecm/bash.out</div><div>urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT </div><div>$ cat ~/bash.*</div><div>Traceback (most recent call last):</div><div>  File "addmissing.py", line 223, in <module></div><div>    main()</div><div>  File "addmissing.py", line 183, in main</div><div>    local_args = pywikibot.handle_args(args)</div><div>  File "/shared/pywikipedia/core/pywikibot/bot.py", line 954, in handle_args</div><div>    writeToCommandLogFile()</div><div>  File "/shared/pywikipedia/core/pywikibot/bot.py", line 1128, in writeToCommandLogFile</div><div>    command_log_file.write(s + os.linesep)</div><div>  File "/usr/lib/python3.4/codecs.py", line 711, in write</div><div>    return self.writer.write(data)</div><div>  File "/usr/lib/python3.4/codecs.py", line 368, in write</div><div>    data, consumed = self.encode(object, self.errors)</div><div>UnicodeEncodeError: 'utf-8' codec can't encode character '\udcc5' in position 67: surrogates not allowed</div><div>CRITICAL: Closing network session.</div><div><class 'UnicodeEncodeError'></div><div>urbanecm@tools-bastion-02 ~/Documents/cswiki/addPrekladCT </div><div>$ </div></div></div>