Skip to content

ValueError: number of bits must be greater than zero from time to time #36

@arashsa

Description

@arashsa

I can't always reproduce this error, but it seems to happen from time to time when using get and set in .rive files. This is the last time I got the error message:

Traceback (most recent call last):
File "/Users/arashsaidi/Work/chatbot/bot/python/lib/python3.5/random.py", line 253, in choice
i = self._randbelow(len(seq))
File "/Users/arashsaidi/Work/chatbot/bot/python/lib/python3.5/random.py", line 230, in _randbelow
r = getrandbits(k) # 0 <= r < 2**k
ValueError: number of bits must be greater than zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 14, in
reply = bot.reply("localuser", msg)
File "/Users/arashsaidi/Work/chatbot/bot/python/lib/python3.5/site-packages/rivescript/rivescript.py", line 999, in reply
return self._brain.reply(user, msg, errors_as_replies)
File "/Users/arashsaidi/Work/chatbot/bot/python/lib/python3.5/site-packages/rivescript/brain.py", line 82, in reply
reply = self._getreply(user, msg, ignore_object_errors=errors_as_replies)
File "/Users/arashsaidi/Work/chatbot/bot/python/lib/python3.5/site-packages/rivescript/brain.py", line 387, in _getreply
reply = random.choice(bucket)
File "/Users/arashsaidi/Work/chatbot/bot/python/lib/python3.5/random.py", line 255, in choice
raise IndexError('Cannot choose from an empty sequence')
IndexError: Cannot choose from an empty sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions