Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot repr redis object without host attribute #262

Closed
pudo opened this issue Feb 5, 2020 · 2 comments
Closed

Cannot repr redis object without host attribute #262

pudo opened this issue Feb 5, 2020 · 2 comments

Comments

@pudo
Copy link

pudo commented Feb 5, 2020

This seems to be due to the lack of .host attribute on the fake redis object:

  File "/aleph/aleph/worker.py", line 77, in get_worker
    log.info("Listen: %s, stages: %s", kv, OPERATIONS)
  File "/usr/lib/python3.7/logging/__init__.py", line 1378, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.7/logging/__init__.py", line 1514, in _log
    self.handle(record)
  File "/usr/lib/python3.7/logging/__init__.py", line 1524, in handle
    self.callHandlers(record)
  File "/usr/lib/python3.7/logging/__init__.py", line 1586, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python3.7/logging/__init__.py", line 894, in handle
    self.emit(record)
  File "/usr/local/lib/python3.7/dist-packages/nose/plugins/logcapture.py", line 82, in emit
    self.buffer.append(self.format(record))
  File "/usr/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/usr/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
  File "/usr/local/lib/python3.7/dist-packages/werkzeug/local.py", line 367, in <lambda>
    __str__ = lambda x: str(x._get_current_object())
  File "/usr/local/lib/python3.7/dist-packages/redis/client.py", line 747, in __repr__
    return "%s<%s>" % (type(self).__name__, repr(self.connection_pool))
  File "/usr/local/lib/python3.7/dist-packages/redis/connection.py", line 1100, in __repr__
    repr(self.connection_class(**self.connection_kwargs)),
  File "/usr/local/lib/python3.7/dist-packages/redis/connection.py", line 522, in __repr__
    repr_args = ','.join(['%s=%s' % (k, v) for k, v in self.repr_pieces()])
  File "/usr/local/lib/python3.7/dist-packages/redis/connection.py", line 527, in repr_pieces
    ('host', self.host),
AttributeError: 'FakeConnection' object has no attribute 'host'
@bmerry bmerry closed this as completed in 2716386 Feb 6, 2020
@bmerry
Copy link
Collaborator

bmerry commented Feb 6, 2020

Thanks for the report. It should be fixed in master.

@pudo
Copy link
Author

pudo commented Feb 6, 2020

Much appreciated, great project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants