Description: Allows destination address to be unicode
 .
 This allows the package to run using python3.
Author: Jean-Michel Nirgal Vourgère <jmv_deb@nirgal.com>
Bug-Debian: https://bugs.debian.org/766752
Forwarded: no
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2014-10-25

Index: python-socksipy-1.02/socks.py
===================================================================
--- python-socksipy-1.02.orig/socks.py
+++ python-socksipy-1.02/socks.py
@@ -212,7 +212,12 @@ class socksocket(socket.socket):
             if self.__proxy[3]:
                 # Resolve remotely
                 ipaddr = None
-                req = req + chr(0x03).encode() + chr(len(destaddr)).encode() + destaddr
+                if type(destaddr) != type(b''): # python3
+                    destaddr_bytes = destaddr.encode()
+                    # TODO: support "xn--" prefixes as defined by RFC 3490
+                else:
+                    destaddr_bytes = destaddr
+                req = req + chr(0x03).encode() + chr(len(destaddr_bytes)).encode() + destaddr_bytes
             else:
                 # Resolve locally
                 ipaddr = socket.inet_aton(socket.gethostbyname(destaddr))
