简体   繁体   中英

dbm 35 Resource temporarily unavailable on OSX python 2.7

I am using the Flask-WeRobot plugin and I am seeing an error being thrown here:

class FileStorage(SessionStorage):
    """
    FileStorage 会把你的 Session 数据以 dbm 形式储存在文件中。

    :param filename: 文件名, 默认为 ``werobot_session``
    """
    def __init__(self, filename='werobot_session'):
        print filename
        try:
          self.db = dbm.open(filename, "c")
        except Exception, e:
          print e
          raise e

This is what is being outputted:

Traceback (most recent call last):
  File "application.py", line 18, in <module>
    another_robot = WeRoBot(token='abcdefg', enable_session=True)
  File "/Users/vng/Dropbox/Code/Paw/venv/lib/python2.7/site-packages/flask_werobot.py", line 42, in __init__
    super(WeRoBot, self).__init__(*args, **kwargs)
  File "/Users/vng/Dropbox/Code/Paw/venv/lib/python2.7/site-packages/werobot/robot.py", line 47, in __init__
    filename=os.path.abspath("werobot_session")
  File "/Users/vng/Dropbox/Code/Paw/venv/lib/python2.7/site-packages/werobot/session/filestorage.py", line 20, in __init__
    self.db = dbm.open(filename, "c")
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/anydbm.py", line 85, in open
    return mod.open(file, flag, mode)
gdbm.error: (35, 'Resource temporarily unavailable')

At first I thought it would have something to do with permissions, but changing the file, werobot_session didn't work.

I am on OSX running python 2.7. This code works on my ubuntu production server.

Any ideas what's causing this?

We find this bug too and we are working on it now.
It seems that it's a bug of gdbm. And everything works fine on linux.
You can check this issue for further information.
https://github.com/whtsky/WeRoBot/issues/102

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM