discogs / pymongo-job-queue

MongoDB-based message queue
https://pypi.python.org/pypi/pymjq
MIT License
19 stars 20 forks source link

AttributeError: 'Cursor' object has no attribute '_Cursor__id' #4

Open Smurf-IV opened 8 years ago

Smurf-IV commented 8 years ago
Traceback (most recent call last):
  File "Z:/spdaemon/app.py", line 184, in _runme
    message = self._jobqueue.next().get('data', None)
  File "Z:\Z_VirtualEnv\lib\site-packages\pymjq\jobqueue.py", line 42, in next
    tailable=True)
  File "Z:\Z_VirtualEnv\lib\site-packages\pymongo\collection.py", line 1137, in find
    return Cursor(self, *args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'tailable'
Exception ignored in: <bound method Cursor.__del__ of <pymongo.cursor.Cursor object at 0x0000000003918048>>
Traceback (most recent call last):
  File "Z:\Z_VirtualEnv\lib\site-packages\pymongo\cursor.py", line 214, in __del__
    if self.__id and not self.__killed:
AttributeError: 'Cursor' object has no attribute '_Cursor__id'

This is just in a client code daemon when calling message = self._jobqueue.next().get('data', None)

Any Ideas ?

Python 3.4.4 Windows 8 x64 Latest MongoDb

accraze commented 8 years ago

Hey @Smurf-IV! I'm currently using Python 2.7.9 on MacOSX running MongoDB v2.6.8. so this might be an issue between the two versions of MongoDB. It looks like something has changed when we specify the tailable cursor https://github.com/discogs/pymongo-job-queue/blob/master/pymjq/jobqueue.py#L43

I'll try and take a look at it when I get some more time in about a week or so. If you figure anything out, feel free to send a PR :)