Page MenuHomePhabricator

pywikibot replace script on PAWS giving error when used with arguments
Closed, InvalidPublic

Description

I tried to run the pwb replace script with file, regex arguments as given in the following log in PAWS environment and got error
The log is given below.

@PAWS:~$ pwb.py replace -file:vemanapages.txt -regex '(?s)^(.*)$' "{{వేమన పద్యాలు }}\n\1"
Traceback (most recent call last):
  File "/srv/paws/pwb/pwb.py", line 365, in <module>
    if not main():
  File "/srv/paws/pwb/pwb.py", line 357, in main
    run_python_file(filename,
  File "/srv/paws/pwb/pwb.py", line 73, in run_python_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
  File "replace.py", line 1191, in <module>
    main()
  File "replace.py", line 917, in main
    if genFactory.handleArg(arg):
AttributeError: 'GeneratorFactory' object has no attribute 'handleArg'
CRITICAL: Exiting due to uncaught exception <class 'AttributeError'>

I was able to run it on my desktop using the pwb Version 6.2.0 dated 28 May 2021 successfully.

Event Timeline

Chicocvenancio moved this task from Backlog to Waiting information on the PAWS board.
Chicocvenancio subscribed.

this is a weird error to be having in PAWS, seems you're using an outdated version of the replace.py script with PAWS updated pywikibot library. Is it possible you downloaded an old version of the pywikibot at some point into your PAWS home folder?

Thanks @Chicocvenancio. You are correct. When I used PAWS earlier, I seem to have tried a copy of replace.py to explore some bug I was experiencing. I forgot to delete it. Now I have deleted and checked that replace.py is working fine.