From 983883dc669953aa3b4903c75eee2ac1ccd5562e Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 2 Jan 2011 22:49:02 +0100 Subject: [PATCH] fix pipe of message to boobmsg (closes #455) --- weboob/applications/boobmsg/boobmsg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weboob/applications/boobmsg/boobmsg.py b/weboob/applications/boobmsg/boobmsg.py index e7de4718..9fa99b68 100644 --- a/weboob/applications/boobmsg/boobmsg.py +++ b/weboob/applications/boobmsg/boobmsg.py @@ -183,7 +183,9 @@ class Boobmsg(ReplApplication): if text is None: if self.interactive: print 'Reading message content from stdin... Type ctrl-D from an empty line to post message.' - text = sys.stdin.read().decode(sys.stdin.encoding) + text = sys.stdin.read() + if sys.stdin.encoding: + text = text.decode(sys.stdin.encoding) if self.options.skip_empty and not text.strip(): return