Page MenuHomePhabricator

Pywikibot doesn't read/write the first title while working on a txt file
Closed, InvalidPublic

Description

I worked on "replace.py" and I noticed that while we are working on a txt file containing (plaintext) titles (like A, B, C) separated by line, it shows:

Retrieving 50 pages from wikipedia:ckb.
WARNING: Page [[ckb:A]] does not exist on wikipedia:ckb.

That page "A" is actually existing, but there could be a bug that don't let to read/write the first page. It is working on next pages (B and C) perfectly.

Event Timeline

Xqt subscribed.

Cannot reproduce this. Having a text file with the following content:

a
b
c

Running the script:

D:\pwb\GIT\core>pwb -lang:ckb replace -file:data/links.txt foo bar
The summary message for the command line replacements will be something like: b?t: l?g?danany kh?g??y d?q  (-foo +bar)
Press Enter to use this automatic message, or enter a description of the
changes your bot will make:
Retrieving 3 pages from wikipedia:ckb.
No changes were necessary in [[ckb:A]]
No changes were necessary in [[ckb:B]]
No changes were necessary in [[ckb:C]]

3 read operations
Execution time: 2 seconds
Read operation time: 0.7 seconds
Script terminated successfully.

Is there an invisible characater within your text file?

Is there an invisible characater within your text file?

Just answering your question. These days I generate my lists using AWB. I checked the list (especially the first title) and no, there wasn't any invisible characters. I don't know why I have the problem, but you don't.