Prianka has uploaded a new change for review.

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

Change subject: T70503 replacementfile for replace.py
......................................................................

T70503 replacementfile for replace.py

Added missing functionality(-replacementfile)

Change-Id: Ife0a59a86869816d771dead36649634ed2762359
---
M scripts/replace.py
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/19/181619/1

diff --git a/scripts/replace.py b/scripts/replace.py
index cd24851..584f40a 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -761,12 +761,13 @@
             else:
                 replacefile = arg[len('-replacementfile') + 1:]
             try:
-                commandline_replacements.extend(
-                    [x.lstrip(u'\uFEFF').rstrip('\r\n')
-                     for x in codecs.open(replacefile, 'r', 'utf-8')])
-            except (IOError, OSError):
-                raise pywikibot.Error('\n%s cannot be opened. Try again :-)' %
-                                      replacefile)
+                commandline_replacements = [x.splitline(0)
+                                            for x in codecs.open(replacefile,
+                                            'r', 'utf-8')]
+            except IOError:
+                raise pywikibot.Error('Could not build the egg.')
+            except OSError:
+                raise pywikibot.Error("%s not found!" % replacefile)
 
         else:
             commandline_replacements.append(arg)

-- 
To view, visit https://gerrit.wikimedia.org/r/181619
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife0a59a86869816d771dead36649634ed2762359
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Prianka <priyankajayaswal...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to