Giter Club home page Giter Club logo

aiouv's People

Contributors

haypoenovance avatar htoothrot avatar ludovic-gasc avatar pyos avatar saghul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiouv's Issues

Proposal: one eventloop for PEP-3156, tornado and gevent

This is how I would like to see the future of rose/pyuv:

  • Make rose Python 2 compatible by dropping tulip dependency
  • Drop tornado-pyuv and uvent
  • Write adapters which map the tornado/gevent loop to PEP-3156, so they could be run with every PEP-3156 compatible event loop

AttributeError: 'EventLoop' object has no attribute '_selector'

I try to use aiohttp with aiouv but get many "Logging error" messages like this when PYTHONASYNCIODEBUG is enabled:

DEBUG:asyncio:Get address info api.github.com:443, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>
DEBUG:asyncio:Getting address info api.github.com:443, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1> took 87.464 ms: [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('192.30.252.127', 443))]
DEBUG:asyncio:connect <socket.socket fd=9, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('0.0.0.0', 0)> to ('192.30.252.127', 443)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/__init__.py", line 980, in emit
    msg = self.format(record)
  File "/usr/lib/python3.5/logging/__init__.py", line 830, in format
    return fmt.format(record)
  File "/usr/lib/python3.5/logging/__init__.py", line 567, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.5/logging/__init__.py", line 330, in getMessage
    msg = msg % self.args
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 537, in __repr__
    polling = _test_selector_event(self._loop._selector,
AttributeError: 'EventLoop' object has no attribute '_selector'
Call stack:
  File "a.py", line 27, in <module>
    content = loop.run_until_complete(task)
  File "/tmp/python/lib/python3.5/site-packages/aiouv/_events.py", line 80, in run_until_complete
    self.run_forever()
  File "/tmp/python/lib/python3.5/site-packages/aiouv/_events.py", line 71, in run_forever
    self._run(pyuv.UV_RUN_DEFAULT)
  File "/tmp/python/lib/python3.5/site-packages/aiouv/_events.py", line 458, in _run
    r = self._loop.run(mode)
  File "/tmp/python/lib/python3.5/site-packages/aiouv/_events.py", line 541, in _process_ready
    handler._run()
  File "/usr/lib/python3.5/asyncio/events.py", line 125, in _run
    self._callback(*self._args)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 293, in _wakeup
    self._step(value, None)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(value)
  File "a.py", line 18, in fetch
    response = await aiohttp.get(url, loop=loop)
  File "/tmp/python/lib/python3.5/site-packages/aiohttp/client.py", line 474, in get
    ret = yield from request(hdrs.METH_GET, url, **kwargs)
  File "/tmp/python/lib/python3.5/site-packages/aiohttp/client.py", line 466, in request
    read_until_eof=read_until_eof)
  File "/tmp/python/lib/python3.5/site-packages/aiohttp/client.py", line 131, in request
    conn = yield from self._connector.connect(req)
  File "/tmp/python/lib/python3.5/site-packages/aiohttp/connector.py", line 292, in connect
    transport, proto = yield from self._create_connection(req)
  File "/tmp/python/lib/python3.5/site-packages/aiohttp/connector.py", line 571, in _create_connection
    server_hostname=hinfo['hostname'] if sslcontext else None)
  File "/usr/lib/python3.5/asyncio/base_events.py", line 669, in create_connection
    sock, protocol_factory, ssl, server_hostname)
  File "/usr/lib/python3.5/asyncio/base_events.py", line 687, in _create_connection_transport
    server_side=False, server_hostname=server_hostname)
  File "/tmp/python/lib/python3.5/site-packages/aiouv/_events.py", line 394, in _make_ssl_transport
    return selector_events._SelectorSslTransport(self, rawsock, protocol, sslcontext, waiter, server_side, server_hostname, extra, server)
  File "/usr/lib/python3.5/asyncio/selector_events.py", line 782, in __init__
    logger.debug("%r starts SSL handshake", self)
Unable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.

How to reproduce:

#!/usr/bin/env python3.5
import logging
import os
import warnings

import aiohttp
import aiouv


os.environ['PYTHONASYNCIODEBUG'] = '1'
logging.basicConfig(level=logging.DEBUG)
warnings.resetwarnings()


async def fetch(url, loop):
    r = await aiohttp.get(url, loop=loop)
    r.close()

loop = aiouv.EventLoop()
try:
    loop.run_until_complete(fetch('https://api.github.com/events', loop=loop))
finally:
    loop.close()

print("Stopped!")

It possible either EventLoop shold be compatible with SelectorEventLoop (#11) or EventLoop shouldn't use any _Selector*Transport directly because they expect SelectorEventLoop.

Rename rose project

Hi,

I'm preparing a commit with a setup.py, but I have an issue on PyPI: rose is already taken:
https://pypi.python.org/pypi/rose

Personally, I'm not a big fan to have a different name on PyPI and on Github, I suggest to rename rose directly to avoid problems.
Some suggestions: aiorose, aiouv, asyncio_rose, asyncio_pyuv, pyuv_rose...

What's your opinion ?

create_udp_endpoint throws exception as getsockname() is called before socket is bound

import aiouv
aiouv.create_udp_endpoint(aiouv.EventLoop(), lambda *a:None, remote_addr=('127.0.0.1', 6001))

Exception:

Traceback (most recent call last):
  File "<pyshell#3>", line 2, in <module>
    aiouv.create_udp_endpoint(aiouv.EventLoop(), lambda *a:None, remote_addr=('127.0.0.1', 6001))
  File "d:\aiouv\aiouv\_transports.py", line 297, in create_udp_endpoint
    addr = handle.getsockname()
pyuv._cpyuv.error.UDPError: (-4071, 'invalid argument')

aiouv tests suite status

It's almost done, I've fixed all tests I can.
@Haypo has planned to change aiotest to avoid to access to self.loop._selector attribute.

If you remove _selector attribute failures, only test_soon_stop_soon doesn't pass, but the test is a little bit mystic for me. For me, the result produced by aiouv is more logical.

If I understand correctly, aiotest is enough to validate PEP 3156.
Could I remove runtests.py or some tests from AsyncIO are necessary ?
Could I enable Travis-CI ?

Is EventLoopPolicy using the wrong base class?

Using the following:

asyncio.set_event_loop_policy(aiouv.EventLoopPolicy)
loop = asyncio.get_event_loop()

I get the following error:

Traceback (most recent call last):
  File "app.py", line 140, in <module>
    asyncio.set_event_loop_policy(aiouv.EventLoopPolicy)
  File "/usr/lib/python3.5/asyncio/events.py", line 620, in set_event_loop_policy
    assert policy is None or isinstance(policy, AbstractEventLoopPolicy)
AssertionError

Python 3.5.1+ (debian)
aiouv from git

Reuse _accept_connection() of SelectorEventLoop

Last week I modified SelectorEventLoop._accept_connection() to fix a bug (close the transport on error). I see that aiouv has copied an old copy (with the bug) of the function. Instead, aiouv should inherit from SelectorEventLoop, or we should retrieve the code differently.

At least, the bug should fix fixed: copy/paste the new code? :-(

can't install by pip on windows, linux

environment

  • OS : windows 10, windows server 2008 R2, Raspbian GNU/Linux 7 (wheezy)
  • python version : 3.4.3, 2.7.9

printed below message.

(python343) D:\venv\python343\Scripts>pip install aiouv
Collecting aiouv
  Could not find a version that satisfies the requirement aiouv (from versions:
)
No matching distribution found for aiouv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.