Page MenuHomePhabricator

replace.py not working (TypeError: 'Replacement' object is not iterable)
Closed, ResolvedPublic

Description

When running replace.py I get the following error:

  File "scripts\replace.py", line 245, in __iter__
    for old, new in self.replacements:
TypeError: 'Replacement' object is not iterable
<type 'exceptions.TypeError'>

Event Timeline

Kronf raised the priority of this task from to Needs Triage.
Kronf updated the task description. (Show Details)
Kronf added a project: Pywikibot.
Kronf changed Security from none to None.
Kronf subscribed.

Do you have a screencast to show this in action?

Oh I think I broke it in https://gerrit.wikimedia.org/r/175228/. I'm looking into it.

More information: Previously the replacements where are a list of tuples. Each tuple contained two values: a compiled regex and the string replacement. I've changed it into the Replacement class which is a bit more flexible, but obviously doesn't return the two values now like a tuple.

Change 177984 had a related patch set uploaded (by XZise):
[FIX] Replace: Sharing exceptions and support XML

https://gerrit.wikimedia.org/r/177984

Patch-For-Review

Change 177984 merged by jenkins-bot:
[FIX] Replace: Sharing exceptions and support XML

https://gerrit.wikimedia.org/r/177984

XZise removed a project: Patch-For-Review.