Comments (8)
which version of curio are you using? I am not aware of this issue.
The direct problem here is that sock
in your context is a coroutine, which of course doesn't have a bind method.
But, I don't know why sock = socket.socket()
returns a coroutine. It's only possible if curio API changed.
from hyper2web.
Can you paste your code?
from hyper2web.
Error in Element
Master Game Example
Https://github.com/CreatCodeBuild/hyper2web/blob/master/example/game/app.py
/home/wku/anaconda3/bin/python "/home/wku/Рабочий стол/[project]/[project_work]/mini/speed_test/server_hyper2web-/hyper2web-dev/example/game/app.py"
init a new record
Traceback (most recent call last):
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/kernel.py", line 826, in _run_coro
trap = current._send(current.next_value)
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/task.py", line 96, in _task_runner
return await coro
File "/home/wku/anaconda3/lib/python3.6/site-packages/hyper2web/server.py", line 24, in h2_server
sock = create_listening_ssl_socket(address, certfile, keyfile)
File "/home/wku/anaconda3/lib/python3.6/site-packages/hyper2web/sslsocket.py", line 23, in create_listening_ssl_socket
sock.bind(address)
AttributeError: 'coroutine' object has no attribute 'bind'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/wku/Рабочий стол/[project]/[project_work]/mini/speed_test/server_hyper2web-/hyper2web-dev/example/game/app.py", line 43, in
app.up()
File "/home/wku/anaconda3/lib/python3.6/site-packages/hyper2web/app.py", line 94, in up
shutdown=True)
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/kernel.py", line 214, in run
raise TaskError('Task Crashed') from ret_exc
curio.errors.TaskError: Task Crashed
sys:1: RuntimeWarning: coroutine 'CurioSSLContext.wrap_socket' was never awaited
Process finished with exit code 1
from hyper2web.
curio.version
'0.7'
from hyper2web.
This is the ssl.py in Curio.
Your problem is related with issue 225 in Curio, which I just opened.
You can either switch to wip
branch or change the source code of hyper2web.
Just in case you are new to coroutines, this is a great tutorial from the author of Curio.
from hyper2web.
Anyway, thank you very much for trying out my framework. Your feedback is the most valuable. Feel free to discuss anything related to this framework. (Feature requests, docs ...)
from hyper2web.
The issue has been fixed in master branch sslsocket.py
csock = ssl_context.wrap_socket(sock)
while True:
try:
csock.send(None)
except StopIteration as e:
sock = e.value
sock.bind(address)
sock.listen()
return sock
I have not updated the repo on pypi yet. Will close this issue after pypi update.
from hyper2web.
Has pushed the fix to pypi
from hyper2web.
Related Issues (20)
- Rest
- Router
- Add Unit Tests HOT 4
- Separate Server and App HOT 3
- Add End-to-End Tests
- serve index.html
- Add a logger
- Should raise an error if no response method is called
- Change end point API to request/response model HOT 1
- Add Application Configuration
- Make it available on PyPi and through pip HOT 1
- http.Response.headers implementation issue HOT 1
- Setup Documents on readthedocs.org
- Report Code Coverage of Tests HOT 1
- HTTP should not do IO
- Fix pip install dependency issue with Curio
- Through an error if the client uses http1 / http1.1
- Join coroutine tasks
- Https HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyper2web.