Hi All,<br><br>I am using Pyrex version 0.9.3.<br><br>for the following pyrex code<br><br>====================================================<br>ctypedef unsigned int size_t<br>cdef extern from &quot;def.h&quot;:<br>&nbsp;&nbsp; ctypedef enum RESULT:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SUCCESS<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FAILURE<br>&nbsp;&nbsp; ctypedef enum bool_t:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FALSE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TRUE<br>cdef extern from &quot;client.h&quot;:<br>&nbsp;&nbsp; ctypedef struct RSA:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass<br>&nbsp;&nbsp; ctypedef struct xmlrpc_server_info:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass
<br>&nbsp;&nbsp; ctypedef struct xmlrpc_env:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass<br>&nbsp;&nbsp; ctypedef struct ServerCTX:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RSA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *rsaPublicPtr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlrpc_server_info&nbsp;&nbsp;&nbsp;&nbsp; *ServerInfoPtr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlrpc_env&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ClientEnv<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int calloced<br>&nbsp;&nbsp; ctypedef struct&nbsp; SessionCTX:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServerCTX *ServerPtr<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned char *keyEnc<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size_t keyEncLen<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; RESULT Connect(SessionCTX **Sessionctx, char *serverHost, unsigned short serverPort,unsigned char *key, size_t keylen)
<br><br>cdef class MyClass:<br>&nbsp;&nbsp; cdef SessionCTX&nbsp; *___Session___<br>&nbsp;&nbsp; def __init__(self,server=&quot;<a href="http://127.0.0.1">127.0.0.1</a>&quot;,port=8080,key=&quot;abcdefgh0123456789&quot;):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.Server=server
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.Port=port<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.Key=key<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.Keylen=len(self.Key)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.res=None<br>&nbsp;&nbsp; def connect(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.res=Connect(&amp;self.__Session__,self.Server,self.Port,&lt;unsigned char *&gt;
self.Key,self.Keylen)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.res<br>==========================================================================================<br>and ypically while calling Connect ie<br>self.res=Connect(&amp;self.__Session__,
self.Server,self.Port,&lt;unsigned char *&gt;self.Key,self.Keylen)<br>i get the following errors/warnings from pyrex<br>test.pyx:37:23: Cannot take address of Python variable<br>test.pyx:37:63: Casting temporary Python object to non-Python type
<br>test.pyx:37:45: Obtaining char * from temporary Python value<br><br><br>I have download and searched through the previous mailing list archievs, however i did not found a post pertaining to same issue, there is one in Jan 2004, which is quite diff. 
<br><br><br>Here i would like to highlight one thing. the library for which i am writing the wrapper initializes and uses SessionCTX * automatically, so basically when i call Connect() SesstionCTX * is initialized.<br><br>
secondly, the c code is generated and compiles with warning, however when i import the module in Python and create an instance of MyClass, it raises AttributeError Exception saying object has no attribute 'Server'.<br><br>
Can anybody pls point to what i am doing wrong here?<br><br>TIA<br>TD6<br>