Opened 11 days ago

Last modified 10 days ago

#30106 new defect

Unable to download server descriptors in stem 1.7

Reported by: cypherpunks Owned by: atagar
Priority: High Milestone:
Component: Core Tor/Stem Version:
Severity: Major Keywords: descriptor
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Using the following code to get tor server descriptors works with stem 1.6, but fails with stem 1.7.

/tmp/stemtest$ cat stem_break.py 
import stem.descriptor.remote
downloader = stem.descriptor.remote.DescriptorDownloader(
            use_mirrors=True,
            timeout=30,
        )
desc = list(downloader.get_server_descriptors())
print(f'Got {len(desc)} tor descriptors')
/tmp/stemtest$ python -m pip install
"stem<1.7"                                                                                                                                                  
Collecting stem<1.7                                                                                                                                                                                                
Installing collected packages: stem
Successfully installed stem-1.6.0
/tmp/stemtest$ python stem_break.py
Got 7387 tor descriptors

But using stem 1.7 this fails

/tmp/stemtest$ python stem_break.py 
Traceback (most recent call last):
  File "stem_break.py", line 6, in <module>
    desc = list(downloader.get_server_descriptors())
  File "/home/newp/.pyenv/versions/stemtest/lib/python3.7/site-packages/stem/descriptor/remote.py", line 630, in get_server_descriptors
    return self.query(resource, **query_args)
  File "/home/newp/.pyenv/versions/stemtest/lib/python3.7/site-packages/stem/descriptor/remote.py", line 811, in query
    return Query(resource, **args)
  File "/home/newp/.pyenv/versions/stemtest/lib/python3.7/site-packages/stem/descriptor/remote.py", line 375, in __init__
    self.endpoints.append(stem.DirPort(endpoint[0], endpoint[1]))  # TODO: remove this in stem 2.0
  File "/home/newp/.pyenv/versions/stemtest/lib/python3.7/site-packages/stem/__init__.py", line 571, in __init__
    raise ValueError("'%s' isn't a valid port" % port)
ValueError: 'None' isn't a valid port

There do not appear to be references to get_server_descriptors function changing in the 1.7 changelog. The environment is python 3.7.1 x64 using ubuntu 18.04.

Child Tickets

Change History (1)

comment:1 Changed 10 days ago by teor

Version: sbws: unspecified
Note: See TracTickets for help on using tickets.