This repository was archived by the owner on Jan 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 198
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
hyper do not work on my Fedora #94
Copy link
Copy link
Closed
Labels
Description
I have problem with running Python hyper library that adds support for HTTP/2 protocol.
On my Fedora machine I installed it with pip and pip3 to use it with Python 2.7.8 and Python 3.4.1. Then I copied test script that connects with twitter:
from hyper import HTTP20Connection
conn = HTTP20Connection('twitter.com:443')
conn.request('GET', '/')
resp = conn.getresponse()
print(resp.read())
I run it using Python 2.7.8 and it ends with error:
[mn:/plib] 1 ‡ python hyper_test.py
Traceback (most recent call last):
File "hyper_test.py", line 4, in <module>
conn.request('GET', '/')
File "/usr/lib/python2.7/site-packages/hyper/http20/connection.py", line 149, in request
self.endheaders(message_body=body, final=True, stream_id=stream_id)
File "/usr/lib/python2.7/site-packages/hyper/http20/connection.py", line 310, in endheaders
self.connect()
File "/usr/lib/python2.7/site-packages/hyper/http20/connection.py", line 215, in connect
self._recv_cb()
File "/usr/lib/python2.7/site-packages/hyper/http20/connection.py", line 580, in _recv_cb
self._consume_single_frame()
File "/usr/lib/python2.7/site-packages/hyper/http20/connection.py", line 496, in _consume_single_frame
frame, length = Frame.parse_frame_header(header)
File "/usr/lib/python2.7/site-packages/hyper/http20/frame.py", line 52, in parse_frame_header
frame = FRAMES[type](stream_id)
KeyError: 80
It ends with different error with Python 3.4.1:
[mn:/plib] 1 ‡ python3 hyper_test.py
Traceback (most recent call last):
File "hyper_test.py", line 4, in <module>
conn.request('GET', '/')
File "/usr/lib/python3.4/site-packages/hyper/http20/connection.py", line 149, in request
self.endheaders(message_body=body, final=True, stream_id=stream_id)
File "/usr/lib/python3.4/site-packages/hyper/http20/connection.py", line 310, in endheaders
self.connect()
File "/usr/lib/python3.4/site-packages/hyper/http20/connection.py", line 204, in connect
sock = wrap_socket(sock, self.host)
File "/usr/lib/python3.4/site-packages/hyper/http20/tls.py", line 44, in wrap_socket
assert ssl_sock.selected_npn_protocol() in H2_NPN_PROTOCOLS
AssertionError
What can cause such problems on my environment?
PS I have also asked such question on StackOverflow: http://stackoverflow.com/questions/28990996/python-hyper-library-do-not-work-on-my-environment
Reactions are currently unavailable