Page MenuHomePhabricator crashes on certain article in Ru.Wp
Closed, ResolvedPublic


When I am running, the bot always crashes after the same article

I don't see anything bad in the article and it seems to be a script problem.


No changes were needed on [[Alleya polkovodcev (Yaroslavl')]] ***
No changes were needed on [[Alleya Geroev (Sankt-Peterburg)]] ***
Traceback (most recent call last):
  File "core/", line 222, in <module>
    run_python_file(filename, argv, argvu, file_package)
  File "core/", line 81, in run_python_file
  File "core/scripts/", line 846, in <module>
  File "core/scripts/", line 843, in main
  File "core/scripts/", line 605, in run
    compressed = io.StringIO(
TypeError: initial_value must be unicode or None, not str
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort


Related Gerrit Patches:

Event Timeline

Rubin16 created this task.Jan 11 2015, 8:56 AM
Rubin16 raised the priority of this task from to Normal.
Rubin16 updated the task description. (Show Details)
Rubin16 added a project: Pywikibot.
Rubin16 added a subscriber: Rubin16.
Xqt updated the task description. (Show Details)Jan 11 2015, 10:10 AM
Xqt set Security to None.
Mpaa added a subscriber: Mpaa.Jan 26 2015, 9:31 PM

I was not able to reproduce it.
Can you provide the full command you used?

If it is possible, I will send you a set of tracebacks with errors in other articles a couple of week later - I am on the business trip now with no access to Labs...
I'll copy the exact command, too.

Aklapper changed the task status from Open to Stalled.Jan 26 2015, 9:59 PM

[Please reset task status once provided]

XZise added a subscriber: XZise.Jan 26 2015, 10:10 PM

This is strange. If it's compressed it's put into a io.StringIO object? For binary data (which is what compressed data is) the io.BytesIO should be used. There is also StringIO.StringIO which accepts both, but was removed in Python 3 so using that should be avoided. Maybe someone (probably me and me) has changed it from StringIO.StringIO to io.StringIO because the latter is available in both and they function similar. So I think there is actually a bug, although I'm not sure why @Mpaa hasn't experienced it. Maybe that section of code wasn't used.

gerritbot added a subscriber: gerritbot.

Change 186950 had a related patch set uploaded (by XZise):
[FIX] reflinks: Use BytesIO for binary data


XZise added a comment.Jan 27 2015, 1:05 PM

I've provided a patch as it looks wrong to me, but I haven't tested it before or afterwards so I'm not sure if this does solve it as @Mpaa hasn't had that problem (although if no gzipped reflink was processed it doesn't happen).

Change 186950 merged by jenkins-bot:
[FIX] reflinks: Use BytesIO for binary data

Rubin16 closed this task as Resolved.Feb 22 2015, 5:02 PM
Rubin16 claimed this task.

Seems to be fixed now.