Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for small problems on Win64 #46

Closed
ggRalf opened this issue Nov 14, 2010 · 3 comments
Closed

Fixes for small problems on Win64 #46

ggRalf opened this issue Nov 14, 2010 · 3 comments

Comments

@ggRalf
Copy link

ggRalf commented Nov 14, 2010

I build pyzmq on Windows7 64bit with VC9.
I tried some examples. Examples using eventloop did not work.

Luckily I was able to fix the errors:

Problem 1:
The following error occured:
Traceback (most recent call last):
File "echo.py", line 27, in
loop.start()
File "c:\Python27\lib\site-packages\zmq\eventloop\ioloop.py", line 255, in start
e = sys.exc_info[1]
TypeError: 'builtin_function_or_method' object is not subscriptable

=> Removing [1] from e = sys.exc_info[1] fixed this problem.

After this fix I got the following error:
Traceback (most recent call last):
File "echo.py", line 27, in
loop.start()
File "c:\Python27\lib\site-packages\zmq\eventloop\ioloop.py", line 244, in start
event_pairs = self._impl.poll(poll_timeout)
File "poll.pyx", line 169, in zmq.core.poll.Poller.poll (zmq\core\poll.c:1980)
File "poll.pyx", line 83, in zmq.core.poll._poll (zmq\core\poll.c:1250)
TypeError: Socket must be a 0MQ socket, an integer fd or have a fileno() method: 140L

In file: poll.pyx I changed line 67 from:
elif isinstance(s, int):
to:
elif isinstance(s, int) or isinstance(s, long):

After this, the examples are Working on windows 64bit.

I'm no expert with git, so I have no branch where you can pull from.
Furthermore I came in touch with Cython the first time and I just "guesed" to make it work. So the bug fixes are probably not optimal. The first fix may break the linux/unix version(?!). The second fix can probably be better implemented. Is there a "size_t" in Cython?

Regards, Ralf

@minrk
Copy link
Member

minrk commented Nov 15, 2010

Thanks for the heads up.

First, the exc_info bug should go to exc_info()[1], not remove the index. sys.exc_info is a function that returns exception info, and I had one type where I tried to index on the function itself, rather that the result. It's behavior is not platform dependent, I just forgot some parentheses.

Yes, Cython does have size_t, but I'm not certain that's what we want here. The traditional way to check against two types is:
isinstance(s, (int,long))

I had to do something slightly more tricky than that in order to preserve Python 3 compatibility, since all ints are longs there, so the long name doesn't exist anymore.

I just pushed these two fixes to a branch
http://github.com/minrk/pyzmq/tree/i46

Can you get that version and let me know if it fixes your problems?

@minrk
Copy link
Member

minrk commented Nov 16, 2010

Fix sys.exc_info typo in ioloop, and typecheck for int/long in poll.

Closed by 359c6e9

@ggRalf
Copy link
Author

ggRalf commented Nov 16, 2010

Sorry for the delay. I'm still fighting with git.
I repeated your changed manually and everything seems to work fine, now.

Thanks!

KeyserSosa pushed a commit to KeyserSosa/pyzmq that referenced this issue Mar 21, 2014
KeyserSosa pushed a commit to KeyserSosa/pyzmq that referenced this issue Mar 21, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants