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

Ensure redis_connect_func is set on uds connection #1794

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

alisaifee
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

Fixes a regression introduced in #1660 when adding the redis_connect_func kwarg to the Connection base class which results in UnixDomainSocketConnection not being usable.

Testing

To reproduce on master:

>>> import redis
>>> redis.Redis.from_url("unix:///tmp/dirty.sock").ping()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    redis.Redis.from_url("unix:///tmp/dirty.sock").ping()
  File "/var/tmp/redis-py/redis/commands/core.py", line 805, in ping
    return self.execute_command("PING", **kwargs)
  File "/var/tmp/redis-py/redis/client.py", line 1156, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/var/tmp/redis-py/redis/connection.py", line 1245, in get_connection
    connection.connect()
  File "/var/tmp/redis-py/redis/connection.py", line 606, in connect
    if self.redis_connect_func is None:
AttributeError: 'UnixDomainSocketConnection' object has no attribute 'redis_connect_func'

@chayim chayim added the bug Bug label Dec 15, 2021
Copy link
Contributor

@chayim chayim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for helping bring unix domain sockets up to the same level as other connections!

@chayim chayim merged commit d17ff59 into redis:master Dec 15, 2021
@lazToum lazToum mentioned this pull request Mar 13, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants