[Pkg-mpd-commits] [python-mpd] 36/262: mpd.py: strip trailing \n from MPD's hello line for a nicer error message
Simon McVittie
smcv at debian.org
Sun May 22 18:16:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch upstream
in repository python-mpd.
commit 285bcce3de90f2e5474978d0bbb5fa4485b957f3
Author: J. Alexander Treuman <jat at spatialrift.net>
Date: Sun Mar 23 17:10:41 2008 -0400
mpd.py: strip trailing \n from MPD's hello line for a nicer error message
---
mpd.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/mpd.py b/mpd.py
index bd68b3c..c924b3c 100644
--- a/mpd.py
+++ b/mpd.py
@@ -275,6 +275,7 @@ class MPDClient(object):
line = self._rfile.readline()
if not line.endswith("\n"):
raise ConnectionError, "Connection lost while reading MPD hello"
+ line = line.rstrip("\n")
if not line.startswith(HELLO_PREFIX):
raise ProtocolError, "Got invalid MPD hello: '%s'" % line
self.mpd_version = line[len(HELLO_PREFIX):].strip()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git
More information about the Pkg-mpd-commits
mailing list