Ok, Here are the details

Os win 2k
python 2.5.2
cython  0.9.8.1.1

1. I am using pure python code to convert .py into .c and compile using 
mingw32.( no cdef stuff)
2. test.py is working fine until unless I am converting into c extension.
3. When using test.pyd, I am getting following error:

Traceback (most recent call last):
  File "demo.py", line 1, in <module>
    import test
  File "test.py", line 33, in test (test..c:831)
    app.MainLoop()
  File "test.py", line 18, in test.MyButtons..__init__ (test.c:413)
    
  File "C:\Python25\Lib\site-packages\pubsubcore\publisher.py", line 86, in 
subscribe
    topicName, desc=noDesc, usingCallable=listener)
  File "C:\Python25\Lib\site-packages\pubsubcore\topics.py", line 423, in 
_newTopicFromTemplate_
    allArgsDocs, required = topicArgsFromCallable(usingCallable)
  File "C:\Python25\Lib\site-packages\pubsubcore\topics.py", line 618, in 
topicArgsFromCallable
    argsInfo = getListenerArgs(_callable)
  File "C:\Python25\lib\site-packages\pubsubcore\callables.py", line 158, in 
getArgs
    (args, va, vkwa, defaultVals) = getargspec(func)
  File "C:\Python25\lib\inspect.py", line 742, in getargspec
    raise TypeError('arg is not a Python function')
TypeError: arg is not a Python function


In second last line of error it seems the listener(self.OnPubSub) at line no. 
17 in test.py:
Publisher.subscribe(self.OnPubSub, "topic")
is changed into something else which "inspect.py" is not able to recognized as 
a function.
Although subscription method is almost same as wxPython events binding, which 
is getting compiled and giving no problems.

I gave a try to pydispatch module and wx.lib.pubsub module to do the same thing 
but none of them are working when test.py is compiled into .pyd.
All of the modules are showing same type of error at line no.17 where we are 
subscribing our listener. Still I am not able to fugure out where actually the 
problem is, is it in the modules or is it with cython?

Hope this helps.

Prashant




----- Original Message ----
From: Stefan Behnel <[EMAIL PROTECTED]>
To: [email protected]
Sent: Monday, 13 October, 2008 3:23:35 PM
Subject: Re: [Cython] pubsub module and cython

Hi,

it's usually a good idea to provide some more more information than "doing
something wrong" and "an error" in your problem report, especially some
hints on what the error output is. Otherwise, you require everyone to
unpack your test code, compile it and run it, although the error
description might already give some (or even enough) hints on what goes
wrong and who might be able to help you.

Stefan

Prashant Saxena wrote:
> I did a simple test of using pubsub module and cython. It seems cython is
> doing something wrong and not able to properly handle listener.
> The code is zipped here.
>
> 1. Run "test.py" and everything is working fine.
> 2. you can compile "test.py" using "setup.bat" on windows. Compiled
> "test.pyd" is also available.
> 3. Run "demo.py". Here you have an error.
>
> Regards
>
> Prashant

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev



      Check out the all-new face of Yahoo! India. Go to http://in.yahoo.com/
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to