You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
I recently upgraded redis-py to the latest version(4.3.3) and began seeing TypeErrors during non-blocking acquisition of locks. It seems like this PR (#2137) introduced an interface change to the Lock.acquire() method.
Any version <= 4.3.1 allowed two ways to acquire a non-blocking lock.
lock.acquire(False)
lock.acquire(blocking=False)
In versions 4.3.2 and 4.3.3 the lock.acquire(False) gives TypeError: acquire() takes 1 positional argument but 2 were given and forces us to use the blocking= keyword arguments.
Version: 4.3.2 + 4.3.3
Platform: Python 3.7.15/Linux
Description:
I recently upgraded redis-py to the latest version(4.3.3) and began seeing TypeErrors during non-blocking acquisition of locks. It seems like this PR (#2137) introduced an interface change to the Lock.acquire() method.
Any version <= 4.3.1 allowed two ways to acquire a non-blocking lock.
lock.acquire(False)
lock.acquire(blocking=False)
In versions 4.3.2 and 4.3.3 the
lock.acquire(False)
givesTypeError: acquire() takes 1 positional argument but 2 were given
and forces us to use theblocking=
keyword arguments.This library https://github.com/sqlalchemy/dogpile.cache/ (probably among others?) uses this redis
Lock().acquire()
and athreading.Lock().acquire()
interchangeably.https://docs.python.org/3/library/threading.html#threading.Lock.acquire
https://github.com/sqlalchemy/dogpile.cache/blob/main/dogpile/lock.py#L126
To maybe belabor the point. This script runs under 4.3.1 but not under 4.3.2
To me, this seems like introducing a breaking change in a patch release which caught me off guard.
The text was updated successfully, but these errors were encountered: