torpyorg / torpy

Pure python Tor client implementation
Apache License 2.0
411 stars 53 forks source link

AttributeError: __enter__ for example from readme #17

Closed rubenhorn closed 3 years ago

rubenhorn commented 3 years ago

What I did:

from torpy import TorClient

hostname = 'ifconfig.me'  # It's possible use onion hostname here as well
with TorClient() as tor:
    # Choose random guard node and create 3-hops circuit
    with tor.create_circuit(3) as circuit:
        # Create tor stream to host
        with circuit.create_stream((hostname, 80)) as stream:
            # Now we can communicate with host
            stream.send(b'GET / HTTP/1.0\r\nHost: %s\r\n\r\n' % hostname.encode())
            recv = stream.recv(1024)

What happened: AttributeError: __enter__

Platform: Windows 10 Home 64bit, Python 3.7.0

jbrown299 commented 3 years ago

Which version torpy you use?

You probably using torpy 1.1.3 (installed from pypi https://pypi.org/project/torpy/) and trying examples from master branch (which 1.1.4 version that not uploaded to pypi). Will release 1.1.4 soon and fix this inconsistency.

jbrown299 commented 3 years ago

torpy v1.1.4 uploaded to pypi now