Page MenuHomePhabricator

SyntaxError: invalid syntax in ndashredir.py
Closed, DuplicatePublic

Description

I wanted to run the script ndashredir.py from https://git.wikimedia.org/blob/pywikibot%2Fcompat.git/HEAD/ndashredir.py so I copied it and created it. However, I now note that it is compat Is this the cause of this issue or something else? Pease help.

C:\Users\Jonatan\AppData\Local\Programs\Python\Python35-32>python C:\Users\Jonatan\Desktop\pywikibot\core\pwb.py ndashredir
Traceback (most recent call last):
  File "C:\Users\Jonatan\Desktop\pywikibot\core\pwb.py", line 256, in <module>
    if not main():
  File "C:\Users\Jonatan\Desktop\pywikibot\core\pwb.py", line 250, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "C:\Users\Jonatan\Desktop\pywikibot\core\pwb.py", line 120, in run_python_file
    exec(compile(source, filename, "exec", dont_inherit=True),
  File "C:\Users\Jonatan\Desktop\pywikibot\core\scripts\ndashredir.py", line 59
    regex = ur'.*[\u2013\u2014]'  # Alt 0150 (n dash), alt 0151 (m dash), respectively.
                     ^
SyntaxError: invalid syntax
<class 'SyntaxError'>
CRITICAL: Closing network session.