On 10/06/2010 02:01 PM, Antoine Pitrou wrote:
It shouldn't. Are you sure you're calling PyType_Ready in the module
initialization routine?
Yeah. The problem was that the type struct was declared 'static' in
another module so the changes `PyType_Ready` made to the struct weren't
applied correc
On Tue, 05 Oct 2010 16:17:57 +0200
"Jonas H." wrote:
>
> Right now I have this minimal struct:
>
> static PyTypeObject StartResponse_Type = {
> PyObject_HEAD_INIT(&PyType_Type)
> 0, /* ob_size */
> "start_response", /* tp_name */
> sizeof(St
On 10/04/2010 11:41 PM, Antoine Pitrou wrote:
Well, it should work, but you have to call PyType_Ready() to fill in
the NULL fields with default values (for those where it's necessary).
Does it solve it for you?
Yes, thank you! Although I do not understand which fields I have to
provide. I want
On Mon, 04 Oct 2010 23:30:58 +0200
"Jonas H." wrote:
>
> > [...] here's a minimal, but __complete__, module that defines a new type:
> >
> > [...]
> > static PyTypeObject noddy_NoddyType = {
> > [...]
> > 0, /*tp_dealloc*/
> > [...]
> > };
>
> So I thought "co
On 10/04/2010 10:46 AM, Jonas H. wrote:
On 10/03/2010 11:52 PM, Antoine Pitrou wrote:
You probably have a problem in your tp_dealloc implementation.
`tp_dealloc` is NULL...
Alright, `tp_dealloc` must not be NULL because it's called by
`_Py_Dealloc`. The C-API tutorial is quite confusing he
On 10/03/2010 11:52 PM, Antoine Pitrou wrote:
You probably have a problem in your tp_dealloc implementation.
`tp_dealloc` is NULL...
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 03 Oct 2010 16:33:48 +0200
"Jonas H." wrote:
>
> Humm. Now the behaviour is as follows:
>
> with assignment to local variable
> --
> * start_response = PyObject_NEW(...) -> start_response->ob_refcnt=1
> * wsgiapp(environ, start_response) ->
On 10/03/2010 03:47 PM, Antoine Pitrou wrote:
You shouldn't call PyObject_FREE yourself, but instead rely on
Py_DECREF to deallocate it if the reference count drops to zero.
So, instead of commenting out Py_DECREF and keeping PyObject_FREE, I'd
recommend doing the reverse. That way, if a referenc
On Sun, 03 Oct 2010 14:44:32 +0200
"Jonas H." wrote:
> On 10/03/2010 01:16 AM, Antoine Pitrou wrote:
> > You should check that you aren't doing anything wrong
> > with "env" and "start_response" (like deallocate them forcefully).
>
> I commented out the `Py_DECREF(start_response)` after the `app`
On 10/03/2010 01:16 AM, Antoine Pitrou wrote:
You should check that you aren't doing anything wrong
with "env" and "start_response" (like deallocate them forcefully).
I commented out the `Py_DECREF(start_response)` after the `app` call and
the crash was gone. `start_response` is created via `P
On Sat, 02 Oct 2010 23:35:01 +0200
"Jonas H." wrote:
>
> This WSGI application:
>
>def app(env, start_response):
>start_response('200 alright', [])
>try:
>a
>except:
>import sys
>sys.exc_info()
>return ['hello']
>
>impo
Hello list,
I have a really weird reference problem with `sys.exc_info`, and, if I'm
right, function frames.
The software in question is bjoern, a WSGI web server written in C,
which you can find at http://github.com/jonashaag/bjoern.
This WSGI application:
def app(env, start_response):
12 matches
Mail list logo