summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nephilim/mpclient.py2
-rw-r--r--nephilim/mpd.py9
2 files changed, 4 insertions, 7 deletions
diff --git a/nephilim/mpclient.py b/nephilim/mpclient.py
index 26b4d13..ceaaeab 100644
--- a/nephilim/mpclient.py
+++ b/nephilim/mpclient.py
@@ -233,7 +233,7 @@ class MPClient(QtCore.QObject):
try:
self._client.command_list_ok_begin()
for path in paths:
- self._client.addid(unicode(path))
+ self._client.addid(path.encode('utf-8'))
ret = self._client.command_list_end()
self._updatePlaylist()
if self._curState == 'stop':
diff --git a/nephilim/mpd.py b/nephilim/mpd.py
index 2d14bb6..30aba98 100644
--- a/nephilim/mpd.py
+++ b/nephilim/mpd.py
@@ -141,17 +141,14 @@ class MPDClient(object):
self._commandlist.append(retval)
def _writeline(self, line):
- self._wfile.write(("%s\n" % line).encode('utf-8'))
+ self._wfile.write("%s\n" % line)
self._wfile.flush()
def _writecommand(self, command, args=[]):
parts = [command]
for arg in args:
- if type(arg)==int:
- parts.append('"%i"' % arg)
- else:
- parts.append(u'"%s"' % escape(arg))
- self._writeline(u" ".join(parts))
+ parts.append('"%s"' % escape(str(arg)))
+ self._writeline(" ".join(parts))
def _readline(self):
line = self._rfile.readline()