Page MenuHomePhabricator

Cosmetic changes is adding unnecessary newline at end
Closed, ResolvedPublic

Description

At the end of the text the cosmetic changes script is adding unnecessary newlines:

python pwb.py cosmetic_changes.py -ns:0 -family:wiktionary -lang:cs -start:\! -summary:"cc" -simulate

ATTENTION: You can run this script as a stand-alone for testing purposes.
However, the changes that are made are only minor, and other users
might get angry if you fill the version histories and watchlists with such
irrelevant changes. Some wikis prohibit stand-alone running.
Do you really want to continue? ([y]es, [N]o) y
Retrieving 50 pages from wiktionary:cs.


>>> ! <<<
@@ -39 +39 @@
- [[th:!]]
+ [[th:!]]

Comment: cc
Do you want to accept these changes? ([y]es, [N]o, [a]ll, [q]uit)

It seems that textlib.replaceLanguageLinks is causing this so maybe it's not a cosmetic changes related problem but more general.

Event Timeline

XZise created this task.Mar 25 2015, 5:39 PM
XZise raised the priority of this task from to Needs Triage.
XZise updated the task description. (Show Details)
XZise added a subscriber: XZise.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMar 25 2015, 5:39 PM
JAnD added a subscriber: JAnD.Mar 25 2015, 10:03 PM
jayvdb triaged this task as Low priority.Oct 16 2015, 4:38 AM
jayvdb added a subscriber: jayvdb.

The bug was fixed by 097245e7e3 . now it is a warning:

$ python pwb.py cosmetic_changes.py -ns:0 -family:wiktionary -lang:cs -page:'!' -summary:"cc" -simulate
ATTENTION: You can run this script as a stand-alone for testing purposes.
However, the changes that are made are only minor, and other users
might get angry if you fill the version histories and watchlists with such
irrelevant changes. Some wikis prohibit stand-alone running.
Do you really want to continue? ([y]es, [N]o): y
Retrieving 1 pages from wiktionary:cs.


>>> ! <<<
WARNING: /home/jayvdb/projects/pywiki/core/pywikibot/textlib.py:1180: DeprecationWarning: Using unstripped text is deprecated; use stripped text instead.
  addOnly=True)

No changes were needed on [[!]]

1 pages read
0 pages written
Execution time: 15 seconds
Read operation time: 15 seconds
Script terminated successfully.
Dalba closed this task as Resolved.Jan 17 2018, 11:05 PM
Dalba claimed this task.
Dalba added a subscriber: Dalba.

The bug was fixed by 097245e7e3 . now it is a warning:

$ python pwb.py cosmetic_changes.py -ns:0 -family:wiktionary -lang:cs -page:'!' -summary:"cc" -simulate
ATTENTION: You can run this script as a stand-alone for testing purposes.
However, the changes that are made are only minor, and other users
might get angry if you fill the version histories and watchlists with such
irrelevant changes. Some wikis prohibit stand-alone running.
Do you really want to continue? ([y]es, [N]o): y
Retrieving 1 pages from wiktionary:cs.
>>> ! <<<
WARNING: /home/jayvdb/projects/pywiki/core/pywikibot/textlib.py:1180: DeprecationWarning: Using unstripped text is deprecated; use stripped text instead.
  addOnly=True)
No changes were needed on [[!]]
1 pages read
0 pages written
Execution time: 15 seconds
Read operation time: 15 seconds
Script terminated successfully.

I cannot reproduce the DeprecationWarning using that particular command but I believe the underlying issue can be resolved through T184886. Marking this task as resolved.