Re: [bug] TypeError: expected pointer, got Int64

Tim Cuthbertson <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <CAC-LLDg3XEuk=Aym3n285oa0V36ncSTMhkPxKcf=jXNK7Q86kQ@mail.gmail.com>
On Mon, Apr 30, 2012 at 7:40 PM, Irmen de Jong <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 30-4-2012 3:33, Tim Cuthbertson wrote:
>> After just installing pyro4 using easy_install (IronPython on windows 7), I get:
>>
>> $ cat pyro_test.py import Pyro4 daemon=Pyro4.Daemon()
>> uri=daemon.register({'test':True}) print "Ready. Object uri =", uri
>> daemon.requestLoop()
>>
>> $ ipy pyro_test.py C:\Program Files (x86)\IronPython
>> 2.7\lib\site-packages\Pyro4\core.py:1: UserWarning: HMAC_KEY not set, protocol data
>> may not be secure """ Traceback (most recent call last): File "C:\Program Files
>> (x86)\IronPython 2.7\lib\site-packages\Pyro4\socketutil.py", line 203, in
>> createSocket File "C:\Program Files (x86)\IronPython
>> 2.7\lib\site-packages\Pyro4\socketutil.py", line 302, in setNoInherit File
>> "pyro_test.py", line 2, in <module> File "C:\Program Files (x86)\IronPython
>> 2.7\lib\site-packages\Pyro4\core.py", line 759, in __init__ File "C:\Program Files
>> (x86)\IronPython 2.7\lib\site-packages\Pyro4\socketserver\threadpoolserver.py",
>> line 101, in init TypeError: expected pointer, got Int64
>>
>
> Okay, I've traced this to be a problem with IronPython (or rather, .NET). It seems
> that it can't get the underlying Windows handle out of the socket object. See this
> issue http://ironpython.codeplex.com/workitem/20242?ProjectName=ironpython
> or this mail thread
> http://python.6.n6.nabble.com/IronPython-and-file-descriptors-td2197344.html
>
> There's nothing Pyro can do about that, other than disabling the setNoInherit function
> in Pyro4.socketutil when it's running on IronPython. Which is what I'm going to do
> right now.
>
> (Why ipy doesn't report that function as the cause of the error is beyond me, it seems
> it's missing one stack frame. The line where it really crashes is 302 in
> socketutil.py, where it calls _SetHandleInformation).
>
>
>
>> Do I need to run a 64 or 32 bit version or something explicitly somehow?
>
> No, the same error occurs on ipy64.exe.
> What you can do in the meantime is apply the attached patch to socketutil.py.
>
>
> Irmen

Thanks for tracking that down, and for the speedy patch - works a treat :)

Cheers,
 - Tim.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.