Comments (7)
But your example works as expected!
from async-timeout.
@asvetlov I need some time to find out why it was an error...
from async-timeout.
But your example works as expected!
What do you mean "expected"?
http://127.0.0.1:8000
URL throws 500 HTTP code and prints in console RuntimeError: Timeout context manager should be used inside a task
error.
Maybe you are using another package version? I have updated first post with requirements.
from async-timeout.
Your example works in new environment with versions specified in requirements.txt
.
The only difference I have Python 3.5.3
from async-timeout.
Anyway, what text are you suggesting?
Current words describe situation when context manager is used from regular callback, tornado's callback or if the loop was not running.
from async-timeout.
@asvetlov I'm not fully understand what is callback
. Please, help me understand.
I just doesn't understand why it have raised an error (as I understand, timeout
class must call asyncio.get_event_loop
at initialisation and store the result in _loop
attribute to use it on __entry__
method call, and it gets initialised when A.am
method called which heppens when I make request to http://127.0.0.1:8000/
URl). And my suggestiongs for the text are dependend on previous "why" question.
from async-timeout.
Because the best error message must tell me what line of code is wrong. But in the reality it isn't possible and I expect just helpfull message that points me at problem. In this case, when using 3.5.2, it isn't for me, because in my head context manager is inside coroutine method, executed inside event loop. But if it is fixed in Python 3.5.3, and everyone can use asyncio.get_event_loop
, thats no problem.
from async-timeout.
Related Issues (20)
- Missing typing_extensions package HOT 1
- It would be nice if timeout could be used as decorator HOT 1
- Please tag a new stable release HOT 4
- `asyncio.TimeoutError` raised on network timeout and CPU timeout HOT 1
- Discussion: should black and other packages be moved from requirements.txt HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- concurrent.futures._base.CancelledError for when timeout happend.
- 3.0.1: test suite warnings HOT 3
- shift_by replaces delay HOT 1
- aiohttp swallows asyncio.CancelledError during connection timeout HOT 33
- a bug or ? HOT 1
- Compatibility issues with pipenv and python 3.9 HOT 5
- code is never stopped HOT 3
- Add `msg` to `task.cancel()` method to allow distinguish the source of cancellation HOT 1
- Tasks are not uncancelled in python 3.11
- Python 3.5.3 requirement HOT 5
- Update all `secret: ` values in `.travis.yml`
- Cancelling current task HOT 6
- nesting HOT 4
- Usage without context (as wait_for) HOT 2
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 async-timeout.