effigies / BitTornado

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

ImportError: cannot import name HTTPSConnection #34

Closed yang502 closed 8 years ago

yang502 commented 8 years ago

I am using the master branch on Python3.5 and Python3.3,both show the Error infos. when i run tracker , it shows as follows:

[root@bogon BitTornado]# python bttrack.py --port 6969 --dfile dstate 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 17, in from http.client import HTTPConnection, HTTPSConnection, HTTPException ImportError: cannot import name HTTPSConnection

effigies commented 8 years ago

Ah, you probably don't have the ssl library. The issue_34 branch should fix it.

To verify, though, can you try import ssl from a python prompt?

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 ?

yang502 commented 8 years ago

Now I using the master branch on Python3.5.2 , and updated my local Stream.py file. I can run the tracker successfull.

My torrent file is :
metainfo file.: VMGL_3D_win7.img.torrent info hash.....: 263b90dc18c5a0c53d07d9c3e7335b4d0d84062c file name.....: VMGL_3D_win7.img file size.....: 720764928 (1374 * 524288 + 393216) announce url..: http://172.21.36.99:6969/announce

But when I want to download the torrent file ,it shows as follows: ERROR: http seed url not http:

saving: VMGL_3D_win7.img (687.4 MB) percent done: 0.0 time left:
download to: /root/BitTornado/VMGL_3D_win7.img download rate:
upload rate:
share rating:
seed status:
peer status:
Traceback (most recent call last): File "btdownloadheadless.py", line 224, in run(sys.argv[1:]) File "btdownloadheadless.py", line 192, in run dow.startRerequester() File "/root/BitTornado/BitTornado/Client/download_bt1.py", line 578, in startRerequester announcers = urls_to_announcers(tracker_urls, _kwargs) File "/root/BitTornado/BitTornado/Client/Announce.py", line 436, in urls_to_announcers for tier in trackerlist] File "/root/BitTornado/BitTornado/Client/Announce.py", line 436, in for tier in trackerlist] File "/root/BitTornado/BitTornado/Client/Announce.py", line 435, in return [[Announcer(url, args, _kwargs) for url in tier] File "/root/BitTornado/BitTornado/Client/Announce.py", line 98, in new return cls.subclasses[scheme](tracker_url, port, args, **kwargs) KeyError: ''

effigies commented 8 years ago

Can you open a new issue? Sorry, but this is a different problem, and I'm closing this issue in #35.