The error is as below:
>>> import cothread
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cothread-2.3-py2.7-macosx-10.6-x86_64.egg/cothread/__init__.py", line 41, in <module>
from cothread import *
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cothread-2.3-py2.7-macosx-10.6-x86_64.egg/cothread/cothread.py", line 82, in <module>
import coselect
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cothread-2.3-py2.7-macosx-10.6-x86_64.egg/cothread/coselect.py", line 60, in <module>
_select_poll = _select.poll
AttributeError: 'module' object has no attribute 'poll'
which is caused by the line 60 in coselect.py.
( _select_poll = _select.poll )
The platform is not tested here, which caused the import error.
Guobao
On 2/9/12 8:10 AM, [email protected] wrote:
From: Shen, Guobao [mailto:[email protected]]
I am using exact the version 2.3 which is from that link.
Did not try your git repo version yet.
Ah.
I *thought* that cothread was working properly under OSX, it was the last time I tried ... which may have been too long ago.
That's a shame, I've just made a 2.4 release, which won't address your problem.
Can you take a closer look and tell me what's happening? I'm puzzled that you're reporting that cothread is using poll(), because I have the following lines in coselect.py:
import platform as _platform
if hasattr(_select, 'poll'):
if _platform.system() == 'Darwin':
# Unfortunately it would appear that Apple's implementation of the
# poll() system call is incomplete: it returns POLLNVAL for devices!
# Apparently kqueue and poll fail on anything in /dev (I suppose they
# work on ordinary files and sockets?)
# So if this is your platform, sorry, we have to use select.
poll_block = poll_block_select
else:
# This is the preferred case.
poll_block = poll_block_poll
The poll_block_select() function does its best to emulate poll() using select(), and it worked last time I looked, at least I thought so. Can you check that, for example, that this code is actually working (maybe _platform.system() has changed, for example?)
--
Guobao Shen
Bldg. 902-B, 17 Cornell Avenue
National Synchrotron Light Source II
Brookhaven National Laboratory
Upton, New York 11973
Tel. : +1 (631) 344 7540
Fax. : +1 (631) 344 8085
http://www.bnl.gov/nsls2
- Replies:
- RE: cothread problem on Mac osx michael.abbott
- RE: cothread problem on Mac osx michael.abbott
- References:
- cothread problem on Mac osx Shen, Guobao
- RE: cothread problem on Mac osx michael.abbott
- RE: cothread problem on Mac osx Shen, Guobao
- RE: cothread problem on Mac osx michael.abbott
- Navigate by Date:
- Prev:
Re: VME SCALER, I2C bus Tim Mooney
- Next:
RE: VME SCALER, I2C bus Mark Rivers
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: cothread problem on Mac osx michael.abbott
- Next:
RE: cothread problem on Mac osx michael.abbott
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|