dsoprea / PyInotify

An efficient and elegant inotify (Linux filesystem activity monitor) library for Python. Python 2 and 3 compatible.
GNU General Public License v2.0
245 stars 73 forks source link

AttributeError: module 'select' has no attribute 'epoll' #36

Open wojtek-fliposports opened 6 years ago

wojtek-fliposports commented 6 years ago
  File "/usr/local/lib/python3.6/site-packages/inotify/adapters.py", line 44, in __init__
    self.__epoll = select.epoll()
AttributeError: module 'select' has no attribute 'epoll'

and select from:

<module 'select' from '/tmp/tmp36/lib/python3.6/lib-dynload/select.cpython-36m-darwin.so'>
wojtek-fliposports commented 6 years ago

it.s under OSX.. sorry.. close or maybe add wrong platform exception

dsoprea commented 6 years ago

Interesting. Our unit-tests stop at 3.5 so we missed this. Can you investigate?

wojtek-fliposports commented 6 years ago

I was trying to run gunicorn under docker linux image on Darwin platform (OSX), gunicorn with --reload feature

jcea commented 6 years ago

"epoll" is linux only. I have a patch to use "selectors" module when using Python >=3.4. This way this library run under SmartOS (a Solaris derivative).

filesystem notifications are highly unportable. MacOS X will surely provide a similar interface but the details are most probably different. In my case, SmartOS provides a linux inotify compatibility layer beside their native filesystem notification, so I can use this library with a half a dozen of line changes.

@dsoprea , are you interested in my patches?. Currently they only work on Python >=3.4, but I could do a Python 2 compatible version.

rkmrHonjo commented 6 years ago

Excuse me,

I used this library on Linux & python3.5, but same error was occurred... Are there other required packages? And, are there any samples about epoll?

rkmrHonjo commented 6 years ago

Really sorry, my above comment was caused by my code... Please ignore it.

dsoprea commented 4 years ago

Patches are welcome.

huzunhao commented 3 years ago

@jcea Could you share your patch?