Bugs item #2485193, was opened at 2009-01-04 10:58 Message generated for change (Comment added) made by nicdumz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2485193...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: other Group: None
Status: Open Resolution: Rejected
Priority: 5 Private: No Submitted By: Murph (pauljmurph) Assigned to: Nobody/Anonymous (nobody) Summary: replace.py: Patch: Ignore variations in newlines on new/old
Initial Comment: Pywikipedia [http] trunk/pywikipedia (r6219, Jan 03 2009, 14:34:49) Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) [GCC 4.0.1 (Apple Inc. build 5465)]
The standard replace.py has a habit of showing a file as having changed, but with zero changes if a \r\n has been changed to \n by one of the patterns. Solution: treat \r\n as \n in the comparison to determine if any changes have been made.
Patch attached.
----------------------------------------------------------------------
Comment By: NicDumZ — Nicolas Dumazet (nicdumz)
Date: 2009-02-22 17:15
Message: Reverted in r6412.
While I understand the issue here, the patch was not the right solution. strip()-ing the text gives unwanted behavior: let's say you wanted to do changes such as "^\r\n" "" ! Well, with that patch, that wasn't possible anymore.
Maybe you could help us giving a special test case where the output is annoying, so we can fix properly the issue? Replace.py is one of the most used scripts here, having the best possible behavior matters to us.
----------------------------------------------------------------------
Comment By: siebrand (siebrand) Date: 2009-01-27 09:45
Message: Applied in r6296. Thanks.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2485193...
pywikipedia-l@lists.wikimedia.org