[pypy-dev] How to help PyPy 3 ?

Amaury Forgeot d'Arc amauryfa at gmail.com
Mon Mar 23 14:08:18 CET 2015


Hi,

2015-03-22 14:45 GMT+01:00 Ludovic Gasc <gmludo at gmail.com>:

> Hi,
>
> I want to try to help PyPy 3, especially to run AsyncIO on PyPy 3.
>
> For now, I've tried to compile PyPy from 3.3 branch, and install AsyncIO.
> I'd an issue with time.monotonic() and time.get_clock_info() in AsyncIO,
> because it isn't implemented in PyPy 3.
>
> I've replaced that by time.time() and hardcoded value of
> time.get_clock_info() return, only to see until AsyncIO should work on PyPy
> 3.
>
> I've launched several examples from AsyncIO documentation, it works,
> except when I launch a TCP client:
> https://docs.python.org/3/library/asyncio-protocol.html#tcp-echo-client-protocol
> I've the same issue with aiotest: https://bitbucket.org/haypo/aiotest All
> tests pass, except:
> $ ./pypy-c -Wd ../tulip/run_aiotest.py
> Run tests in debug mode
> ...............E
> ======================================================================
> ERROR: test_tcp_hello (aiotest.test_network.NetworkTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File
> "/home/lg/Documents/IDEA/pypy/site-packages/aiotest/test_network.py", line
> 78, in test_tcp_hello
>     self.loop.run_until_complete(coro)
>   File
> "/home/lg/Documents/IDEA/pypy/site-packages/asyncio/base_events.py", line
> 317, in run_until_complete
>     return future.result()
>   File "/home/lg/Documents/IDEA/pypy/site-packages/asyncio/futures.py",
> line 275, in result
>     raise self._exception
>   File "/home/lg/Documents/IDEA/pypy/site-packages/asyncio/tasks.py", line
> 238, in _step
>     result = next(coro)
>   File "/home/lg/Documents/IDEA/pypy/site-packages/asyncio/coroutines.py",
> line 79, in __next__
>     return next(self.gen)
>   File
> "/home/lg/Documents/IDEA/pypy/site-packages/asyncio/base_events.py", line
> 644, in create_connection
>     sock, protocol_factory, ssl, server_hostname)
> TypeError: '_SelectorSocketTransport' object is not iterable
>

Please file a bug, this is an issue with "yield from" and return values.
The script below prints "(1, 2)" with CPython3, but "1" with pypy3.3

def f():
    yield 3
    return 1, 2

def g():
    x = yield from f()
    print(x)

list(g())



>
> ----------------------------------------------------------------------
> Ran 16 tests in 0.337s
>
> FAILED (errors=1)
>
> Finally, I've tested to launch the aiohttp server example:
> https://github.com/KeepSafe/aiohttp/blob/master/examples/srv.py
> The servers starts, but when I launch a HTTP request, I've a strange
> stackstrace:
> Error handling request
> Traceback (most recent call last):
>   File "/home/lg/Documents/IDEA/pypy/site-packages/aiohttp/server.py",
> line 240, in start
>     yield from handler
>   File "/home/lg/tmp/asyncio_examples/7_aiohttp_server.py", line 25, in
> handle_request
>     message.method, message.path, message.version))
> AttributeError: 'str' object has no attribute 'method'
> Traceback (most recent call last):
>   File "/home/lg/Documents/IDEA/pypy/site-packages/aiohttp/server.py",
> line 240, in start
>     yield from handler
>   File "/home/lg/tmp/asyncio_examples/7_aiohttp_server.py", line 25, in
> handle_request
>     message.method, message.path, message.version))
> AttributeError: 'str' object has no attribute 'method'
>
> After debugging a little bit with pdb, I see
> that aiohttp.HttpRequestParser parses correctly the request, but "message =
> yield from httpstream.read()" in aiohttp.server at line 226 returns "GET"
> string instead of a RawRequestMessage object.
>
> I'm a total newbie about PyPy internals, implement a monotonic timer seems
> to be over-complicated to me.
> But, I should maybe help with tests and fix small issues like with
> aiohttp.server if I've a clue to fix that.
> Are you interested if I create issues on PyPy project for each problem, or
> I will add only noise in PyPy project ?
>
> BTW, to help PyPy project not only with my brain time, I've did a small
> recurring donation for PyPy 3.
>
> Regards.
> --
> Ludovic Gasc (GMLudo)
>
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> https://mail.python.org/mailman/listinfo/pypy-dev
>
>


-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150323/2daca908/attachment.html>


More information about the pypy-dev mailing list