Giter VIP home page Giter VIP logo

pyuv's Introduction

pyuv: Python interface for libuv

image

pyuv is a Python module which provides an interface to libuv. libuv is a high performance asynchronous networking and platform abstraction library.

libuv is built on top of epoll/kequeue/event ports/etc on Unix and IOCP on Windows systems providing a consistent API on top of them.

pyuv's features:

  • Non-blocking TCP sockets
  • Non-blocking named pipes
  • UDP support (including multicast)
  • Timers
  • Child process spawning
  • Asynchronous DNS resolution (getaddrinfo)
  • Asynchronous file system APIs
  • High resolution time
  • System memory information
  • System CPUs information
  • Network interfaces information
  • Thread pool scheduling
  • ANSI escape code controlled TTY
  • File system events (inotify style and stat based)
  • IPC and TCP socket sharing between processes
  • Arbitrary file descriptor polling
  • Thread synchronization primitives

CI status

Stable branch (v1.x)

  • Travis CI:

    image

  • AppVeyor:

    image

Versioning

Starting with version 1.0.0, pyuv follows the Semantic Versioning specification, like libuv does.

All releases are downloadable from the GitHub tags page, and the latest stable release from PyPI.

Documentation

http://readthedocs.org/docs/pyuv/

Installing

pyuv can be installed via pip as follows:

pip install pyuv

Building

Get the source:

git clone https://github.com/saghul/pyuv

Linux:

./build_inplace

Mac OSX:

(XCode needs to be installed)
export ARCHFLAGS="-arch x86_64"
./build_inplace

Microsoft Windows (with Visual Studio):

python setup.py build_ext --inplace

Running the test suite

There are several ways of running the test ruite:

  • Run the test with the current Python interpreter:

    From the toplevel directory, run: nosetests -v

  • Use Tox to run the test suite in several virtualenvs with several interpreters

    From the toplevel directory, run: tox this will run the test suite on Python 2.7, 3.3 and 3.4 (you'll need to have them installed beforehand)

Author

Saúl Ibarra Corretgé <[email protected]>

License

Unless stated otherwise on-file pyuv uses the MIT license, check LICENSE file.

Python versions

Python 2.7, and Python >= 3.3 versions are supported.

Contributing

If you'd like to contribute, fork the project, make a patch and send a pull request. Have a look at the surrounding code and please, make yours look alike :-)

pyuv's People

Contributors

altanozlu avatar ayanamist avatar benoitc avatar djlauk avatar eulerreich avatar geertj avatar iskra avatar iyedb avatar jayvdb avatar jmp-2 avatar masahitojp avatar poupas avatar pyos avatar rblank avatar romuald avatar saghul avatar schlamar avatar tilgovi avatar tolbertam avatar waywardmonkeys 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  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  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

pyuv's Issues

Keep reference count when handle is active

When a handle's reference count goes to zero, the handle is removed from the loop (this is done in Handle_tp_dealloc()). This is quite a pain, as you need to ensure that you always keep a reference to your handles. A few times I wanted to use the following idiom to schedule a run-once callback. The code below prints nothing, unless you uncomment the "global" statement in schedule_callback, in which case it prints "callback!".

import pyuv

loop = pyuv.Loop.default_loop()

def callback(handle):
    print('callback!')
    handle.close()

def schedule_callback(callback):
    #global prep  # uncomment 
    prep = pyuv.Prepare(loop)
    prep.start(callback)

schedule_callback(callback)
loop.run()

You could argue this is a bug in the code. However I think it's not programmer friendly to require the programmer to keep a reference to a handle:

  • The callback function gets a handle. This is a hint to the programmer that he doesn't need to keep his own copy.
  • Garbage collectors differ on the different Python platforms. The CPython one is eager and will free an object as soon as its refcount goes to zero. I'm not sure this is the case on e.g. Jython and Pypy. This different behavior can lead to programs behaving differently.
  • It makes it more difficult to refactor code. For example, if you'd take the schedule_callback() function above and move its body to the module-level, it would have worked.

I think it would be better if a reference is taken to the handle when start() is called, which is release when the handle is closed. This prevents this common error, and is e.g. also what gevent does.

TCP & UDP don't expose the fd

Now that these methods support the open method, there should also be a way to expose the file descriptor, so we can pass it to other functions.

pipe write assert crash

download next two files
git://gist.github.com/4043607.git
git://gist.github.com/4043603.git

run python_d test.py

libuv, pyuv, python are debug version

Process.kill always trigger on_exit_cb

Not sure if it's intended but when using the kill function the on_exit_cb is always triggered. So event sending SIGHUP trigger it . Also return_code & terM_signal are similar to the results returned by sending SIGTERM using the kill function.

TTY doc

TTY now take the fd parameter in init but this isn't documented.

Crashes on Windows 7 (32 bits)

Crashes are found when running the following modules/functions on Windows 7 (32 bits) with MinGW:

  • pyuv.util.cpu_info
  • pyuv.fs.*
  • pyuv.dns.DNSResolver

The error message reads as follows:

$ gdb python
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from c:\Python27\python.exe...(no debugging symbols found)...done.
(gdb) run DISABLEDtest_dns.py
Starting program: c:\Python27\python.exe DISABLEDtest_dns.py
[New Thread 2700.0xcec]
test_getaddrinfo (__main__.DNSTest) ... [New Thread 2700.0xac0]
warning: HEAP[python.exe]:
warning: Invalid address specified to RtlFreeHeap( 00390000, 00302B90 )


Program received signal SIGTRAP, Trace/breakpoint trap.
0x770c4685 in ntdll!RtlpSetUserPreferredUILanguages ()
   from C:\Windows\system32\ntdll.dll
(gdb)

These crashes don't manifest on Windows XP, sigh.

util module declaration problem

There is a problem with the module declaration of util:

>>> from pyuv import util
>>> util.hrtime()
192352689419120
>>> from pyuv.util import hrtime
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named util

pyuv.Idle issue

When calling a method in a class using the Idle object, the event is never triggered:

>>> loop = pyuv.Loop.default_loop()
>>> class test(object):
...     def __init__(self, loop):
...             self.loop = loop
...     def publish(self):
...             idle = pyuv.Idle(self.loop)
...             idle.start(self._send)
...     def _send(self, h):
...             print("test")
...             h.stop()
...             h.close()
... 
>>> t = test(loop)
>>> t.publish()
>>> loop.run()

Add thread module?

libuv supports a number of cross platform low level threading synchronization primitives such as semaphores,mutextes and conditions. A quick non-scientific test shows that a wrapper around uv_sem_t is about 4 times faster than the CPython Semaphone implementation.

Not sure if I should add that to pyuv, but here are the experiments: https://github.com/saghul/pyuv/tree/thread_module

Segmentation fault

I just got a segfault while testing:

$ nosetests -w tests/
....................S.....................E..............EE............FE.......
.E....SSSS......SS...Segmentation fault

Platform: Windows 7 64bit, Python 2.7 32bit.
Sadly not reproducible.

Failed to build 0.8.2 under Windows

When i try to build pyuv 0.8.2 under Windows, it tells me

C:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\src\pyuv.o build\temp.win32-2.7\Release\src\pyuv.def -Lc:\Python27\libs -Lc:\Python27\PCbuild -Ldeps\libuv -lpython27 -luv -liphlpapi -lpsapi -lws2_32 -o d:\pyuv-0.8.2\pyuv.pyd
deps\libuv/libuv.a(core.o): In function uv_init': d:\pyuv-0.8.2\deps\libuv/src/win/core.c:58: undefined reference to__set_invalid_parameter_handler'

I look over the related code, and find it's a CRT related code. Since libuv is supporting MSVC officially, it's not surprising.

So i hope you can support msvc asap (i know it's a hard work).

And python setup.py build_ext in build_inplace file is not working. I must use python setup.py build instead, otherwise it will only build libuv but not pyuv, and halt on building 'pyuv' extension after No need to build libuv.

Thanks buddy.

futures.ThreadPoolExecutor or pyyv.ThreadPool ?

I am trying to choose what to use between futures.ThreadPoolExecutor or pyyv.ThreadPool. Especially since with pyuv I don't have to manage another dependency for Python 2.7. I saw there was a lot of improvements in latest libuv & pyuv code about ThreadPool, but since I am condamned to use only stable release (hopefully 0.10 will be out soon) what is the best to use right now?

gevent integration?

This is great! Have you thought about integrating this with gevent? It'd be really awesome! Right now gevent is using libev (in the development version).

Also, does this run on PyPy? One major blocker for people wanting to move to PyPy is lack of gevent support. If this could be used as the backend for gevent, and if this ran on PyPy, then that'd be pretty great! I know PyPy has some C-API support as well as ctypes support -- though I'm not sure which is faster or prefered.

write() accepts unicode strings

While trying to evaluate tornado and pyuv, I noticed that pyuv's write() and writelines() methods accept unicode strings as input. This is mildly acceptable in Python 2 (even if, IMO, bad practice), but it is not in Python 3 where bytes and str types are entirely distinct and non-implicitly convertible. In both cases I think it is better to refuse unicode input, since which charset to use is really a function of the higher-level protocol, and therefore should be decided by the user, not the event library.

(e.g. Twisted, AFAIR, will refuse unicode input)

pending tasks in loop

It seems that active_handlers only return the number of active handlers at a a time but not return the real number of pending tasks. For example I can have one pending ticker not showing as active; should I reference all the loop tasks unsing ref() ?

"goto error" after RAISE ?

pipe.c:

    r = uv_write2(wr, (uv_stream_t *)UV_HANDLE(self), bufs, buf_count, (uv_stream_t *)UV_HANDLE(send_handle), on_stream_write);
    if (r != 0) {
        RAISE_UV_EXCEPTION(UV_HANDLE_LOOP(self), PyExc_PipeError);
        goto error;
    }

What does RAISE_UV_EXCEPTION? If it raises a real exception, how would be the next goto error be executed? "raise" is supposed to do longjmp, sure:

http://books.google.es/books?id=nEJ-jcYF2fMC&pg=PA576&lpg=PA576&dq=python+exception+longjmp&source=bl&ots=3-vDQ199qp&sig=AgDvKJfclcs0LSdVK-yJke45smU&hl=es&sa=X&ei=P0vKT6u_KYys8QOg5rTsDw&ved=0CGAQ6AEwAQ#v=onepage&q=python%20exception%20longjmp&f=false

Maybe you have a "PyUV" exception handler that "absorbs" the exception, releases the loop and raise the stored exception?

Add Python2.5 or older support

add following code to pyuv.c, under "#include "pyuv.h"

//Must define Py_TYPE for Python 2.5 or older

ifndef Py_TYPE

define Py_TYPE(o) ((o)->ob_type)

endif

//Must define PyVarObject_HEAD_INIT for Python 2.5 or older

ifndef PyVarObject_HEAD_INIT

define PyVarObject_HEAD_INIT(type, size) \

   PyObject_HEAD_INIT(type) size,

endif

//Must define PyModule_AddIntMacro for Python 2.5 or older

ifndef PyModule_AddIntMacro

define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)

endif

//Must define PyBytes_FromStringAndSize for Python 2.5 or older

ifndef PyBytes_FromStringAndSize

define PyBytes_FromStringAndSize PyString_FromStringAndSize

endif

//Must define PyBytes_FromString for Python 2.5 or older

ifndef PyBytes_FromString

define PyBytes_FromString PyString_FromString

endif

will make it support python25 or older

Handle_tp_dealloc called twice

1.tcp.write()
2.tcp's refcount reach 0 then tp_dealloc be called
3.on_stream_write be called,
Py_INCREF(self) refcount 1
Py_DECREF(self) refcount 0 so handle_tp_dealloc be called second time

Is this a problem?

uv_close also have this problem

errno 1 in stream is EOF.

Had hard time to figure that the errno in stream was different from the python one. ie 1 in this case mean EOF. (python say errno.EPERM) . Maybe returning "" instead would be more pythonic ? Anyway would worth to mention it in the doc :)

socket write() should take memoryview type not raise MemoryError

If you write a memoryview to a socket, you will get a MemoryError raised.

In this case, string = memoryview("blah")

Traceback (most recent call last):
File "..\socket_pyuv_write_memoryview.py", line 31, in
incoming_socket.write(string, write_callback)
MemoryError

ssl, unix sockets & ipv6

Is there a way to handle ipv6 and unix socket? Sound like libuv is abble to handle that but i'm not sure it's possible currently with pyuv?

Assertion `loop->watchers[w->fd] == w' failed

The following code will abort pyuv by triggering the assertion:

src/unix/core.c:651: uv__io_stop: Assertion loop->watchers[w->fd] == w' failed.`.

According to the libuv docs it is safe to close an FD after you stop() the poll handle. But even if it isn't safe, I think pyuv should not abort the program. In case of a programming error, it should raise an exception.

import os
import pyuv

def on_write(handle, events, errno):
    pass

loop = pyuv.Loop.default_loop()
r1, w1 = os.pipe()
poll1 = pyuv.Poll(loop, w1)
poll1.start(pyuv.UV_WRITABLE, on_write)
loop.run_once()  # -> pipe is writable
poll1.stop()
os.close(r1); os.close(w1)
# libuv docs tell it's safe to close the FD after stop()

r2, w2 = os.pipe()
assert w1 == w2, 'Try again'
poll2 = pyuv.Poll(loop, w2)
poll2.start(pyuv.UV_WRITABLE, on_write)
loop.run_once()
poll1.close()  # -> crash
poll2.close()

pyuv.Signal

Looking at the code it seems that we now start to handle a signal by passing (callback, signum) . Does it mean we can start as many signum handle we want for a Signal instance ? eg.

   s = pyuv.Signal(loop)
   s.start(handle_quit, signal.SIGQUIT)
   s.start(handle_quit, signal.SIGINT) 

wish: to have pyuv ported to Pypy...

Hi there,

This is just a wish: it would be great to have pyuv working on Pypy. There is no problem compiling and installing it with Pypy, but some unit tests fail:

test_fsevent_dir (__main__.FSEventTest) ... ok
test_fsevent_nrefile (__main__.FSEventTest) ... ok
test_fsevent_basic (__main__.FSEventTestBasic) ... ok
test_fspoll1 (__main__.FSPollTest) ... RPython traceback:
  File "pypy_interpreter_gateway.c", line 842, in BuiltinCodePassThroughArguments1_funcrun_obj
  File "pypy_module_cpyext_api_4.c", line 40772, in generic_cpy_call__StdObjSpaceConst_funcPtr_SomeI
  File "pypy_module_cpyext_pyobject.c", line 568, in make_ref
  File "pypy_module_cpyext_pyobject.c", line 1486, in create_ref
Fatal RPython error: AssertionError
Aborted (core dumped)

test_client1 (__main__.TCPErrorTest) ... ok
test_client2 (__main__.TCPErrorTest) ... ok
test_open (__main__.TCPErrorTest) ... ok
test_tcp_flags (__main__.TCPFlagsTest) ... ok
test_tcp_shutdown (__main__.TCPShutdownTest) ... ok
test_tcp1 (__main__.TCPTest) ... ok
test_tcp_write_cancel (__main__.TCPTest2) ... ok
test_tcp_list (__main__.TCPTestList) ... ok
test_tcp_list_null (__main__.TCPTestListNull) ... ok
test_tcp_list_unicode (__main__.TCPTestListUnicode) ... RPython traceback:
  File "pypy_interpreter_gateway.c", line 842, in BuiltinCodePassThroughArguments1_funcrun_obj
  File "pypy_module_cpyext_api_4.c", line 40772, in generic_cpy_call__StdObjSpaceConst_funcPtr_SomeI
  File "pypy_module_cpyext_pyobject.c", line 568, in make_ref
  File "pypy_module_cpyext_pyobject.c", line 1486, in create_ref
Fatal RPython error: AssertionError
Aborted (core dumped)

test_udp_pingpong (__main__.UDPTest) ... RPython traceback:
  File "pypy_interpreter_gateway.c", line 842, in BuiltinCodePassThroughArguments1_funcrun_obj
  File "pypy_module_cpyext_api_4.c", line 40772, in generic_cpy_call__StdObjSpaceConst_funcPtr_SomeI
  File "pypy_module_cpyext_pyobject.c", line 568, in make_ref
  File "pypy_module_cpyext_pyobject.c", line 1486, in create_ref
Fatal RPython error: AssertionError
Aborted (core dumped)

Thanks in advance

Alvaro

Add thread module?

libuv supports a number of cross platform low level threading synchronization primitives such as semaphores,mutextes and conditions. A quick non-scientific test shows that a wrapper around uv_sem_t is about 4 times faster than the CPython Semaphone implementation.

Not sure if I should add that to pyuv, but here are the experiments: https://github.com/saghul/pyuv/tree/thread_module

Handle callback function call exit

diff --git a/src/pyuv.h b/src/pyuv.h
index 817507f..de58b12 100644
--- a/src/pyuv.h
+++ b/src/pyuv.h
@@ -562,6 +562,9 @@ handle_uncaught_exception(Loop *loop)

 ASSERT(loop);
 ASSERT(PyErr_Occurred());
  • if (PyErr_ExceptionMatches(PyExc_SystemExit)) {
  •  PyErr_PrintEx(1);/_exit app_/
    
  • }

PyErr_Fetch(&type, &val, &tb);
PyErr_NormalizeException(&type, &val, &tb);

DNSResolver causes silent crash on Windows

Windows 7. New pyd built from latest:

fa9f5c1

The following code:

import pyuv
loop = pyuv.Loop.default_loop()
print "1"
dns = pyuv.dns.DNSResolver(loop)
print "2"

Results in:

1

And then the application exits.

Segmentation fault in pyuv.fs.write()

The following test gives a segmentation fault on Fedora 18.

import os
import stat

from common import unittest2
import pyuv

TEST_FILE = 'test_file_1234'

loop = pyuv.Loop.default_loop()
fd = pyuv.fs.open(loop, TEST_FILE, os.O_RDWR, 0755)
pyuv.fs.write(loop, fd, "TEST", 0)  # <= crash here

I get the following stack trace with gdb:

Program received signal SIGSEGV, Segmentation fault.
__memcpy_sse2 () at ../sysdeps/x86_64/memcpy.S:95
95      movl    (%rsi), %ecx
(gdb) bt
#0  __memcpy_sse2 () at ../sysdeps/x86_64/memcpy.S:95
#1  0x00007ffff07dab9a in memcpy (__len=<optimized out>, __src=<optimized out>, __dest=0x6ce450) at /usr/include/bits/string3.h:51
#2  FS_func_write (obj=<optimized out>, args=<optimized out>, kwargs=<optimized out>) at src/fs.c:2247
#3  0x000000366bedd281 in call_function (oparg=<optimized out>, pp_stack=0x7fffffffdde8) at /usr/src/debug/Python-2.7.3/Python/ceval.c:4098
#4  PyEval_EvalFrameEx (f=f@entry=Frame 0x6cbe90, for file test.py, line 12, in <module> (), throwflag=throwflag@entry=0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:2740
#5  0x000000366beddcbf in PyEval_EvalCodeEx (co=co@entry=0x7ffff7f23a30, globals=globals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, locals=locals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, args=args@entry=0x0, argcount=argcount@entry=0, 
    kws=kws@entry=0x0, kwcount=kwcount@entry=0, defs=defs@entry=0x0, defcount=defcount@entry=0, closure=closure@entry=0x0)
    at /usr/src/debug/Python-2.7.3/Python/ceval.c:3330
#6  0x000000366beddd92 in PyEval_EvalCode (co=co@entry=0x7ffff7f23a30, globals=globals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, locals=locals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}) at /usr/src/debug/Python-2.7.3/Python/ceval.c:689
#7  0x000000366bef6f7a in run_mod (mod=<optimized out>, filename=filename@entry=0x7fffffffe52b "test.py", globals=globals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, locals=locals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, flags=flags@entry=0x7fffffffe060, arena=arena@entry=
    0x6c8670) at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:1361
#8  0x000000366bef7d72 in PyRun_FileExFlags (fp=fp@entry=0x6c8dc0, filename=filename@entry=0x7fffffffe52b "test.py", start=start@entry=257, 
    globals=globals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, locals=locals@entry=
    {'stat': <module at remote 0x7ffff7f7efa0>, 'TEST_FILE': 'test_file_1234', '__builtins__': <module at remote 0x7ffff7fa1ad0>, 'unittest2': <module at remote 0x7ffff7edb788>, '__file__': 'test.py', '__package__': None, 'fd': 14, 'pyuv': <module at remote 0x726fd8>, '__name__': '__main__', 'os': <module at remote 0x7ffff7f67cc8>, '__doc__': None, 'loop': <pyuv.Loop at remote 0x748578>}, closeit=closeit@entry=1, flags=flags@entry=0x7fffffffe060)
    at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:1347
#9  0x000000366bef878b in PyRun_SimpleFileExFlags (fp=fp@entry=0x6c8dc0, filename=0x7fffffffe52b "test.py", closeit=1, flags=flags@entry=
---Type <return> to continue, or q <return> to quit---
    0x7fffffffe060) at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:951
#10 0x000000366bef93c9 in PyRun_AnyFileExFlags (fp=fp@entry=0x6c8dc0, filename=<optimized out>, closeit=<optimized out>, flags=flags@entry=
    0x7fffffffe060) at /usr/src/debug/Python-2.7.3/Python/pythonrun.c:755
#11 0x000000366bf09c52 in Py_Main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/Python-2.7.3/Modules/main.c:639
#12 0x0000003652a21a05 in __libc_start_main (main=0x4006f0 <main>, argc=2, ubp_av=0x7fffffffe218, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffe208) at libc-start.c:225
#13 0x0000000000400721 in _start ()

This is against the current master (f7859a3).

Build chain fails if VS 2008 and VS 2010 is installed

I'm getting the error:

fatal error C1900: Inkompatibilität zwischen "P1", Version "20081201", und "P2",
 Version "20080116"
LINK : fatal error LNK1257: Fehler bei Codegenerierung.

Sorry for the German messages (again), but the error message should be clear. I'm sure that libuv gets built with VS 2010 while pyuv uses VS 2008 (for Python 2.7), causing this incompatibility.

Uninstalling VS 2010 is a workaround for this issue.

pyuv fails to build on Windows with Python 3.3

This is with the latest pyuv from github, and Python 3.3 (64-bit) on Windows 7.

>python setup.py build_ext --inplace
running build_ext
libuv needs to be compiled.
Building libuv...
Traceback (most recent call last):
  File "setup.py", line 38, in <module>
    ('LIBUV_REVISION', libuv_build_ext.libuv_revision)]
  File "C:\Apps\Python33\Lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Apps\Python33\Lib\distutils\dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "C:\Apps\Python33\Lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "C:\Apps\Python33\Lib\distutils\command\build_ext.py", line 347, in run
    self.build_extensions()
  File "C:\Work\Projects\pyuv\setup_libuv.py", line 79, in build_extensions
    self.get_libuv()
  File "C:\Work\Projects\pyuv\setup_libuv.py", line 137, in get_libuv
    build_libuv()
  File "C:\Work\Projects\pyuv\setup_libuv.py", line 119, in build_libuv
    exec_process('cmd.exe /C vcbuild.bat release', cwd=self.libuv_dir, env=env, shell=True)
  File "C:\Work\Projects\pyuv\setup_libuv.py", line 45, in exec_process
    raise DistutilsError('Got return value %d while executing "%s", stderr output was:\n%s' % (returncode, " ".join(cmdline), stderr.rstrip("\n")))
TypeError: Type str doesn't support the buffer API

I get the same error with "pip install pyuv"...

Allow objects to be inheritable

It should be possible to subclass the classes defined by pyuv. This is currently not possible, because the Py_TPFLAGS_BASETYPE flag is not provided in the tp_flags element of the type definition structures.

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.