Excellent question. On my own computer, I am using 2.7.12 but on labs it is 3.4.3
Of note, when I changed my code such that all cases of *ur'...'* now read *u'...' *the script worked in both environments. So it has to do with how escaping works in python, I guess. But I am not sure.
On Sun, Aug 19, 2018 at 4:48 PM Alex Monk krenair@gmail.com wrote:
What are the versions of Python involved?
On Sun, 19 Aug 2018 at 21:34, Huji Lee huji.huji@gmail.com wrote:
Hello,
When I run this script[1] on my own machine it runs without any problem. When I run it on Labs, I get an invalid syntax error, pasted below. Can you please help me figure out why?
Thanks!
(venv)tools.huji@tools-bastion-03:~$ python core/pwb.py webcite -page:"SOME PAGE" Traceback (most recent call last): File "core/pwb.py", line 253, in <module> if not main(): File "core/pwb.py", line 246, in main run_python_file(filename, [filename] + args, argvu, file_package) File "core/pwb.py", line 114, in run_python_file exec(compile(source, filename, "exec", dont_inherit=True), File "core/scripts/userscripts/webcite.py", line 125 faCitationPattern = ur'{{\s*یادکرد(?:{{.*?}}|.)*?}}'
[1] https://github.com/PersianWikipedia/fawikibot/blob/master/webcite.py _______________________________________________ Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud
Wikimedia Cloud Services mailing list Cloud@lists.wikimedia.org (formerly labs-l@lists.wikimedia.org) https://lists.wikimedia.org/mailman/listinfo/cloud