effigies / BitTornado

UNMAINTAINED - John Hoffman's fork of the original bittorrent
Other
150 stars 44 forks source link

BF: Only import HTTPSConnection if ssl import succeeds #35

Closed effigies closed 8 years ago

effigies commented 8 years ago

Closes #34.

yang502 commented 8 years ago

Thanks for your reply! 1、I try import ssl from a python prompt.It prompt without _ssl module.So I install ssl and reconfigure Python.Then retry to run tracker,it shows another problem:

Traceback (most recent call last): File "bttrack.py", line 7, in from BitTornado.Tracker.track import track File "/root/BitTornado/BitTornado/Tracker/track.py", line 16, in from .T2T import T2TList File "/root/BitTornado/BitTornado/Tracker/T2T.py", line 4, in from BitTornado.Client.Announce import Announcer File "/root/BitTornado/BitTornado/Client/Announce.py", line 14, in from BitTornado.Network.Stream import SharedStream File "/root/BitTornado/BitTornado/Network/Stream.py", line 220, in class ShareHTTPS(ShareHTTP): File "/root/BitTornado/BitTornado/Network/Stream.py", line 229, in ShareHTTPS SSLCONTEXT = ssl.create_default_context() AttributeError: 'module' object has no attribute 'create_default_context'

2、Is master branch supporte all the Python3.x version? The problem I encountered is because of the wrong Python environment ?

effigies commented 8 years ago

Looks like create_default_context was added in 3.4. I copied the defaults from 3.5.2 for installations without it.