Skip to content

v4.3.2 contains backwards incompatible change to redis.lock.Lock #2209

Closed
@sgg

Description

@sgg

Version: 4.3.2

Platform: Python 3.9 (applicable to all)

Description: PR #2137 converted several arguments to redis.lock.Lock.__init__ into keyword only arguments. This is backwards incompatible as it disallows the use of these arguments positionally. Releasing this w/ 4.3.2 also violates semver 😅

The following snippet can be used to repro. It works fine on 4.3.1 but fails on 4.3.2 w/ a TypeError:

from redis import Redis
from redis.lock import Lock

def main():
    r = Redis("localhost:6379")
    Lock(r, "schlage", None)

if __name__ == "__main__":
    main()
redis432 ❯ python nope.py
Traceback (most recent call last):
  File "nope.py", line 9, in <module>
    main()
  File "nope.py", line 6, in main
    Lock(r, "schlage", None)
TypeError: __init__() takes 3 positional arguments but 4 were given

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions