Subject: python-dictclient is not unicode aware Package: python-dictclient Version: 1.0.3.1 Severity: wishlist Tags: patch
Unicode strings cannot be used in queries, and there is no workaround for the problem. {{{ connection = dictclient.Connection() test = "\u00e9" connection.match("*", "exact", test) }}} The error message is: UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 0: ordinal not in range(128) Best, Balazs -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.30-2-686 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash Versions of packages python-dictclient depends on: ii python 2.5.4-2 An interactive high-level object- o ii python-central 0.6.11 register and build utility for Pyt python-dictclient recommends no packages. Versions of packages python-dictclient suggests: ii dictd 1.11.1+dfsg-3 dictionary server
Common subdirectories: dictclient-1.0.3/debian and dictclient-1.0.3-uc/debian diff dictclient-1.0.3/dictclient.py dictclient-1.0.3-uc/dictclient.py 48,49c48,49 < self.rfile = self.sock.makefile("rt") < self.wfile = self.sock.makefile("wt", 0) --- > self.rfile = self.sock.makefile("rb") > self.wfile = self.sock.makefile("wb", 0) 56c56 < line = self.rfile.readline().strip() --- > line = self.rfile.readline().strip().decode("utf-8") 75c75 < line = self.rfile.readline().strip() --- > line = self.rfile.readline().strip().decode("utf-8") 166c166 < self.wfile.write(command + "\n") --- > self.wfile.write((command + "\n").encode("utf-8"))