summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico2011-11-18 18:20:21 (GMT)
committerZac Medico2011-11-18 18:20:21 (GMT)
commit935694debc955a18a6a93af923f3f98caacf3f74 (patch)
tree112323c2e48440188e0446ee61f70ad4cbacb7d0
parentd47f28881fcdd57d239e9b6e57ccb2755855d4ca (diff)
collect_ebuild_messages: handle \r, bug #390833
-rw-r--r--pym/portage/elog/messages.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py
index ba2ed46..a4897d8 100644
--- a/pym/portage/elog/messages.py
+++ b/pym/portage/elog/messages.py
@@ -54,8 +54,9 @@ def collect_ebuild_messages(path):
f = io.open(_unicode_encode(filename,
encoding=_encodings['fs'], errors='strict'),
mode='r', encoding=_encodings['repo.content'], errors='replace')
- for l in f:
- l = l.rstrip('\n')
+ # Use split('\n') since normal line iteration or readlines() will
+ # split on \r characters as shown in bug #390833.
+ for l in f.read().split('\n'):
if not l:
continue
try: