Opened 6 years ago

Closed 5 weeks ago

#10522 closed enhancement (duplicate)

Client usage tutorial incompatable with some SocksiPy versions

Reported by: atagar Owned by: atagar
Priority: Low Milestone:
Component: Archived/Stem Version:
Severity: Normal Keywords: website
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Our client usage tutorial (To Russia With Love) is reportedly incompatible with certain SocksiPy versions.

The tutorial works with the standard SocksiPy Version 1.4.2 as well as Version 1.0 but not version 1.01...


  File "/usr/lib64/python2.7/site-packages/", line 163, in sendall
    if 'encode' in dir(bytes):
RuntimeError: maximum recursion depth exceeded while calling a Python object


  File "/usr/lib64/python2.7/site-packages/", line 399, in connect
  File "/usr/lib64/python2.7/site-packages/", line 313, in __negotiatesocks4
    req = "\x04\x01" + struct.pack(">H",destport).decode() + ipaddr
UnicodeDecodeError: 'ascii' codec can't decode byte 0xbb in position 1: ordinal not in range(128)

Child Tickets

Change History (5)

comment:1 Changed 6 years ago by robinson

Have you tried this with neehi <>? I forked SocksiPy, added various patches I found around the web, and added fixes of my own (including Python 3 support). I renamed the result to neehi and posted it to PyPi. I would be interested to know if your tutorial does not work with neehi.

I do not think SocksiPy or SocksiPy-branch are supported any longer and you probably do not need to worry about finding bugs in them.

By "standard SocksiPy Version 1.4.2", do you mean PySocks <>? PySocks and neehi are both currently maintained.

comment:2 Changed 6 years ago by atagar

Have you tried this with neehi <​>?

Hi Sean. Nope, I haven't tried Neehi. If you'd care to add a subsection for using Neehi (like the one for PycURL) I'd be happy to add it. Bonus points for adding it to our tutorial tests but not mandatory (I've shamefully not written tests for this tutorial yet).

By "standard SocksiPy Version 1.4.2", do you mean PySocks?

When I first wrote this tutorial it was for SocksiPy 1.0. I'm not quite sure what the original reporter meant by 1.4.2 but that might be it. Sounds like we should double check that our tutorial works with PySocks then replace SocksPy with PySocks.

comment:3 Changed 5 years ago by atagar

Quick other note that the bit where we monkey patch socket is causing confusion since people then try to combine this example with a controller connection. Monkey patching means the controller is routed over tor, naturally then being rejected.

I've seen questions about this a few times now. Improvements to the example would be welcome.

comment:4 Changed 2 years ago by teor

Severity: Normal

Set all open tickets without a severity to "Normal"

comment:5 Changed 5 weeks ago by atagar

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.