pymongo-job-queue icon indicating copy to clipboard operation
pymongo-job-queue copied to clipboard

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

Open Smurf-IV opened this issue 9 years ago • 1 comments

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

Smurf-IV avatar Jul 18 '16 13:07 Smurf-IV

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 :)

accraze avatar Jul 19 '16 16:07 accraze