Page MenuHomePhabricator

pagefromfile may fail into infinite loop
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • create a file (pages1.txt) with any wikipage content but only one page without any delimiter
  • run pwb pagefromfile -simulate -notitle -textonly -file:pages1.txt

What happens?:

D:\pwb\GIT\core>pwb pagefromfile -simulate -notitle -textonly -file:pages1.txt


Reading 'pages1.txt'...

No title found - skipping a page.

No title found - skipping a page.

...

No title found - skipping a page.

No title found - skipping a page.

No title found - skipping a page.
Retrieving 1 pages from wikipedia:de.

KeyboardInterrupt during PageFromFileRobot bot run...

2 read operations
Execution time: 1 seconds
Read operation time: 0.5 seconds
Script terminated successfully.

D:\pwb\GIT\core>

What should have happened instead?:

There is only one page to process.

Software version (skip for WMF-hosted wikis like Wikipedia):
Tested with 4.0 and 7.6 but I guess this error exists since compat 1.0

Event Timeline

Xqt changed the task status from Open to In Progress.Jul 24 2022, 10:24 AM
Xqt claimed this task.
Xqt triaged this task as Medium priority.
Xqt renamed this task from pagefromfile may fail into infinite looe to pagefromfile may fail into infinite loop.Jul 24 2022, 10:30 AM

Change 816295 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [BUGFIX] Exit loop in PageFromFileReader if match.end() <= 0

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

Change 816295 merged by Mpaa:

[pywikibot/core@master] [BUGFIX] Exit loop in PageFromFileReader if match.end() <= 0

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