| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Prior to this, escaped slashes ("\\") were un-escaped. This caused the strings
"foo\x92" and "foo\\x92" to be represented the same way in the output.
Fixes #1349
|
| |
|
|
|
|
|
|
|
|
|
| |
Prevent the pool from closing sockets on connections that are actively in use
by other threads when the master address changes. Connections returned to the
pool that are still connected to the old master will be disconnected
gracefully.
Fixes #1345
|
| |
|
|
|
| |
Update the cached master_address if the Sentinels promote a new master.
|
|
|
|
| |
Fixed #1339
|
| |
|
|
|
|
|
| |
The lock does not need to be held while waiting for the socket to
establish and validate the TCP connection.
|
| |
|
|
|
|
|
| |
Fixes #1337
Fixes #1341
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
flake8 catches a wider net of mistakes than pycodestyle and is more
commonly used by the larger community. For example, it catches unused
imports, a few of which existed. These have since been removed.
Two "noqa" comments were added. One ignores the _compat.py file as it
has a large amount of Python version specific code. The second is in
utils.py which intentionally does not use an import.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Python command line argument -b causes Python to emit a warning when
bytes and str usage is mixed. This is generally considered bad practice
as either one or the other is required. Enabling this feature during
tests helps catch them before reaching production.
The warning appeared as:
tests/test_scripting.py::TestScripting::test_eval_msgpack_pipeline_error_in_lua
.../redis-py/redis/client.py:3967: BytesWarning: str() on a bytes instance
cmd = ' '.join(imap(safe_unicode, command))
|
|
|
|
| |
sorted() takes any iterable and always returns a new list. No need to
eagerly coerce to a list.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling str() on a bytes object can result in a BytesWarning being
emitted and usually indicates a mixup between byte and string handling.
Now, in the event of an invalid RESP response, use the repr value of the
raw response in the exception message.
Can further simplify the bytes/str handling by comparing the first byte
as a bytes object instead of converting it to str. The bytes literal is
available on all supported Pythons. This removes the need for the
compatibility function, byte_to_chr().
|
|
|
|
| |
As Python 3 is the future of the language, when the docs need to make a
syntax choice, use the Python 3 version.
|
|
|
|
|
|
| |
The lexer is documented at:
https://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer
It is the preferred lexer for the Python console and its output.
|
|
|
| |
Covers the class redis.utils.dummy.
|
|
|
|
|
|
|
|
|
| |
Use the "as" keyword to capture the exception in a variable instead of
sys.exc_info().
Re-raise exception with the bare "raise" syntax.
Avoid "# noqa: E722" by catching BaseException, which includes all
exceptions including SystemExit.
|
|
|
|
|
|
| |
Now matches the parent class signature. Running the benchmark previously
failed with the error:
TypeError: send_packed_command() got an unexpected keyword argument 'check_health'
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For details on this feature, see:
https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files
Setuptools allows using setup.cfg as a configuration file to define the
package metadata and options. This approach reduces boilerplate code in
favor of a declarative configuration. Down the road, this approach also
allows for automation through scripts and tools.
|
|/ |
|
|
|
|
|
|
|
| |
Lock.extend() now has a new option, `replace_ttl`. When False (the
default), Lock.extend() adds the `additional_time` to the lock's existing
TTL. When replace_ttl=True, the lock's existing TTL is replaced with
the value of `additional_time`.
|
|
|
|
| |
replace with a '6.0.0' literal when Redis 6 is GA
|
|
|
|
|
| |
fixes #1304
fixes #1280
|
| |
|
|
|
|
|
|
|
| |
The `EXECABORT` error type was added in Redis 2.6.5 and is returned from an
`EXEC` command to indicate that the transaction was aborted due to an invalid
command. It is not necessary to call `DISCARD` after this error, and doing so
causes a "DISCARD without MULTI" error.
|
|
|
| |
fix: https://github.com/andymccurdy/redis-py/issues/1296
|
|
|
|
| |
fixes #1298
|
|
|
|
| |
Fixes #1268
|
|
|
|
|
|
|
|
|
|
| |
This allows memoryview instances to be passed to Redis command args that
expect strings or bytes. The memoryview instance is sent directly to
the socket such that there are zero copies made of the underlying data
during command packing.
Fixes #1265
Fixes #1285
|
|
|
|
|
|
|
|
|
| |
When waiting to acquire a lock, the Lock object will sleep until
the lock is acquired or until blocking_timeout has elapsed. This optimization
calculates whether the next iteration will occur after blocking_timeout
has elapsed and short circuits it immediately.
Fixes #1263
|
|
|
|
| |
Fixes #1279
|
|
|
|
| |
Ref #1274
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an exception occurs inside the __del__ method, it should be reported
to the developer. Not doing so could hide bugs.
Python automatically handles exceptions inside __del__ methods, for
example:
class A:
def __del__(self):
1 / 0
A()
print("after del")
Results in the output:
$ python3 ~/blah.py
Exception ignored in: <function A.__del__ at 0x7fbbf2bbfc20>
Traceback (most recent call last):
File "/home/jon/test.py", line 3, in __del__
1 / 0
ZeroDivisionError: division by zero
after del
From this example, we can see the bug was not hidden and the code after
__del__ still executed.
fixes #1281
|
| |
|
|
|
|
|
|
| |
Helps identify problematic or buggy code. When a warning is displayed,
it should be analyzed and fixed.
The r and r2 fixture now close the client after the test is complete.
|
|
|
|
|
|
|
|
|
| |
It now describe what is deprecated and displays for the callers line by
using stacklevel=2.
The warning is now tested and not emitted during normal test runs.
Fixes #1282
|
|
|
|
|
|
|
|
|
|
|
|
| |
* make `hset` command support multi field/value pairs.
see: https://redis.io/commands/hset
close https://github.com/andymccurdy/redis-py/issues/1269
deprecated: hmset
Co-authored-by: Alan Mai <0110amai@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After further thought this was a bad idea. Just because two connection
pools share the same connection arguments does not make them equal.
It would seem quite odd if pool_a == pool_b yet pool_a.disconnect() doesn't
close all of pool_b's connections.
Ref #1240
Fixes #1277
Fixes #1275
Fixes #1267
Fixes #1273
|
|
|
|
|
|
|
| |
This helps those poor souls that specify all their connection options as
non-keyword arguments.
Fixes #1276
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to ACL support, redis-py ignored the username component of
Connection URLs. With ACL support, usernames are no longer ignored and
are used to authenticate against an ACL rule. Some cloud vendors with
managed Redis instances (like Heroku) provide connection URLs with a
username component pre-ACL that is not intended to be used. Sending that
username to Redis servers < 6.0.0 results in an error. Attempt to detect
this condition and retry the AUTH command with only the password such
that authentication continues to work for these users.
Fixes #1274
|
| |
|