jeffreywugz / pyev

Automatically exported from code.google.com/p/pyev
0 stars 0 forks source link

PyErr_SetFromErrnoWithFilenameObject not defined in pypy #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I can build pyev for pypy but PyErr_SetFromErrnoWithFilenameObject shows up as 
being implicitly defined and on import it comes up as an error. I suggest using 
one of the other functions for pypy compatibility.

Original issue reported on code.google.com by papercr...@reversefold.com on 9 Jan 2012 at 4:52

GoogleCodeExporter commented 9 years ago
Hi,

What would you suggest to work around this (see 
http://code.google.com/p/pyev/source/browse/trunk/pyev/src/Watcher.c#167)?

malek

PS: I submitted a feature request to implement 
PyErr_SetFromErrnoWithFilenameObject in pypy (https://bugs.pypy.org/issue991) 
while we try to figure this out (you never know).

Original comment by lekma...@gmail.com on 10 Jan 2012 at 10:21

GoogleCodeExporter commented 9 years ago
the link should be: 
http://code.google.com/p/pyev/source/browse/trunk/pyev/src/Watcher.c#167

Original comment by lekma...@gmail.com on 10 Jan 2012 at 10:22

GoogleCodeExporter commented 9 years ago
Here's a possible fix for this issue:

https://github.com/msabramo/pyev/commit/197a8ffe870e072ac0cf9e7a66b4010bb7cf6043

Original comment by msabr...@gmail.com on 21 Mar 2014 at 9:14

GoogleCodeExporter commented 9 years ago
Newer versions of pypy will support `PyErr_SetFromErrnoWithFilenameObject` it 
seems.

See https://bugs.pypy.org/issue991

Though now that I'm looking at this again, it seems that this is an abuse of 
`PyErr_SetFromErrnoWithFilenameObject`  and you probably could use a different 
function like `PyErr_Format` 
(http://docs.python.org/2/c-api/exceptions.html?highlight=pyerr_setfromerrnowith
filenameobject#PyErr_Format).

Original comment by msabr...@gmail.com on 24 Mar 2014 at 3:36

GoogleCodeExporter commented 9 years ago
I wonder if something as simple as this could work:

diff --git a/src/Watcher.c b/src/Watcher.c index f067657..88852a3 100644 --- a/src/Watcher.c +++ b/src/Watcher.c @@ -133,11 +133,9 @@ Watcher_Callback(struct ev_loop loop, ev_watcher watcher, int revents) if (revents & EV_ERROR) { if (!PyErr_Occurred()) { if (errno) { // there's a high probability it is related

Original comment by msabr...@gmail.com on 24 Mar 2014 at 4:44

Attachments: