Skip to content

Does not work with redis-py 3.2 #235

@MattBlack85

Description

@MattBlack85

If I install 1.0.1 and try to execute what doc says I obtain the following error:

In [1]: import fakeredis                                                                                                                                                                                                                                                                                                   

In [2]: r = fakeredis.FakeStrictRedis()                                                                                                                                                                                                                                                                                    

In [3]: r.set('a', 'b')                                                                                                                                                                                                                                                                                                    
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-9aae901f3e7b> in <module>
----> 1 r.set('a', 'b')

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/redis/client.py in set(self, name, value, ex, px, nx, xx)
   1449         if xx:
   1450             pieces.append('XX')
-> 1451         return self.execute_command('SET', *pieces)
   1452 
   1453     def __setitem__(self, name, value):

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/elasticapm/instrumentation/packages/base.py in call_if_sampling(self, module, method, wrapped, instance, args, kwargs)
    103         transaction = get_transaction()
    104         if not transaction or not transaction.is_sampled:
--> 105             return wrapped(*args, **kwargs)
    106         else:
    107             return self.call(module, method, wrapped, instance, args, kwargs)

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/elasticapm/instrumentation/packages/base.py in call_if_sampling(self, module, method, wrapped, instance, args, kwargs)
    103         transaction = get_transaction()
    104         if not transaction or not transaction.is_sampled:
--> 105             return wrapped(*args, **kwargs)
    106         else:
    107             return self.call(module, method, wrapped, instance, args, kwargs)

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/redis/client.py in execute_command(self, *args, **options)
    770         pool = self.connection_pool
    771         command_name = args[0]
--> 772         connection = pool.get_connection(command_name, **options)
    773         try:
    774             connection.send_command(*args)

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/redis/connection.py in get_connection(self, command_name, *keys, **options)
    992         try:
    993             # ensure this connection is connected to Redis
--> 994             connection.connect()
    995             # connections that the pool provides should be ready to send
    996             # a command. if not, the connection was either returned to the

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/redis/connection.py in connect(self)
    498 
    499         self._sock = sock
--> 500         self._selector = DefaultSelector(sock)
    501         try:
    502             self.on_connect()

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/redis/selector.py in DefaultSelector(sock)
    194         else:
    195             raise RedisError('Platform does not support any selectors')
--> 196     return _DEFAULT_SELECTOR(sock)

~/.local/share/virtualenvs/api-fKmI9ai6/lib/python3.6/site-packages/redis/selector.py in __init__(self, sock)
    122             super(PollSelector, self).__init__(sock)
    123             self.read_poller = select.poll()
--> 124             self.read_poller.register(sock, self._READ_POLLER_MASK)
    125             self.ready_poller = select.poll()
    126             self.ready_poller.register(sock, self._READY_POLLER_MASK)

TypeError: argument must be an int, or have a fileno() method.

Any idea of what is wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions