jenkins-bot has submitted this change and it was merged.

Change subject: Fix line ending stripping for monitoring script
......................................................................


Fix line ending stripping for monitoring script

Text mode did not reliable normalize line endings. Hence, we now trim
them manually.

Change-Id: Ic9c01a8a0ce695db6904712f0bfec2e1c1bf3022
---
M aggregator/projectcounts.py
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Nuria: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/aggregator/projectcounts.py b/aggregator/projectcounts.py
index 565ddca..5703edd 100644
--- a/aggregator/projectcounts.py
+++ b/aggregator/projectcounts.py
@@ -580,9 +580,7 @@
 
             if len(lines):
                 # Analyze last line
-                last_line = (lines[-1]).split('\n', 1)[0]  # Since the file is
-                # opened in text mode by default, line ends are normalized to
-                # LF, event though CRLF gets written.
+                last_line = (lines[-1]).rstrip('\n\r')
                 last_line_split = last_line.split(',')
                 if len(last_line_split) == 5:
                     # Check if last line is current.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9c01a8a0ce695db6904712f0bfec2e1c1bf3022
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aggregator
Gerrit-Branch: master
Gerrit-Owner: QChris <[email protected]>
Gerrit-Reviewer: Nuria <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to