https://bugzilla.wikimedia.org/show_bug.cgi?id=55210
Web browser: --- Bug ID: 55210 Summary: new lines not managed correctly Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1415/ Reported by: paolobenve Created on: 2012-03-03 12:53:35 Subject: new lines not managed correctly Original description: $ python version.py Pywikipedia [http] trunk/pywikipedia (r9946, 2012/03/01, 09:52:33) Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48) [GCC 4.4.5] config-settings: use_api = True use_api_login = True unicode test: triggers problem #3081100
Linux debian
I'm using the bot on the server itself where mediawiki is installed.
If I insert a new line with the replace.py script (e.g., with the replace string like "asdf\n"), a subsequent regex search of the same string (e.g, "asdf\n") won't match, while "asdf\r\n" will match.
It seems that when the bot must insert \n, actualy it inserts \r\n.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55210
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- maybe it's mediawiki who inserts. Just use "asdf\r?\n" for the regex
https://bugzilla.wikimedia.org/show_bug.cgi?id=55210
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/bugs/1415
https://bugzilla.wikimedia.org/show_bug.cgi?id=55210
Maarten Dammers maarten@mdammers.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |maarten@mdammers.nl, | |paolobenve@gmail.com Resolution|--- |WORKSFORME
--- Comment #2 from Maarten Dammers maarten@mdammers.nl --- If you want to insert new lines you can use "\n" or "\r\n", if you want to look for end of lines you have to use "\r\n". This is just the way MediaWiki works.
See also http://programmers.stackexchange.com/questions/29075/difference-between-n-an... for reference.
pywikipedia-bugs@lists.wikimedia.org