summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* mark and close stale issues and PRsroey-stale_issuesRoey Prat2020-06-291-0/+20
|
* Do not un-escape \ characters when parsing MONITOR outputAndy McCurdy2020-06-082-1/+11
| | | | | | | 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
* 3.5.33.5.3Andy McCurdy2020-06-011-1/+1
|
* SentinelConnectionPool plays better with threaded applications.Andy McCurdy2020-06-013-14/+53
| | | | | | | | | 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
* changelogAndy McCurdy2020-05-201-0/+1
|
* [sentinel] update master address if it changes. (#847)Jake2020-05-201-0/+1
| | | Update the cached master_address if the Sentinels promote a new master.
* Restore try/except in __del__ methodsAndy McCurdy2020-05-203-8/+26
| | | | Fixed #1339
* 3.5.23.5.2Andy McCurdy2020-05-141-1/+1
|
* Tune the locking in ConnectionPool.get_connectionAndy McCurdy2020-05-142-21/+26
| | | | | The lock does not need to be held while waiting for the socket to establish and validate the TCP connection.
* 3.5.13.5.1Andy McCurdy2020-05-091-1/+1
|
* Fix for HSET argument validation to allow any non-None keyAleksMat2020-05-093-4/+11
| | | | | Fixes #1337 Fixes #1341
* Python 2 compatibility noteAndy McCurdy2020-04-301-0/+10
|
* version 3.5.03.5.0Andy McCurdy2020-04-292-3/+5
|
* point docs link to "stable" versionAndy McCurdy2020-04-291-2/+2
|
* Fix typo (missing space) in exception message (#1334)Jon Dufresne2020-04-282-2/+6
|
* Switch to flake8 for static code analysis (#1328)Jon Dufresne2020-04-168-12/+9
| | | | | | | | | 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.
* Enable BytesWarning during test and fix discovered case (#1322)Jon Dufresne2020-04-132-2/+6
| | | | | | | | | | | | 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))
* Remove unnecessary coerce to list (#1321)Jon Dufresne2020-04-131-1/+1
| | | | sorted() takes any iterable and always returns a new list. No need to eagerly coerce to a list.
* Fix str/bytes mixup in PythonParser.read_response() (#1324)Jon Dufresne2020-04-133-18/+26
| | | | | | | | | | | | 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().
* Prefer Python 3 syntax in examples (#1325)Jon Dufresne2020-04-132-20/+20
| | | | As Python 3 is the future of the language, when the docs need to make a syntax choice, use the Python 3 version.
* Use pycon lexer to highlight code Python console code blocks (#1327)Jon Dufresne2020-04-131-30/+30
| | | | | | 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.
* Add test for Lock(..., thread_local=False) (#1326)Jon Dufresne2020-04-111-0/+7
| | | Covers the class redis.utils.dummy.
* Simplify exception handlers (#1319)Jon Dufresne2020-04-113-27/+21
| | | | | | | | | 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.
* Add missing check_health argument to Connection overrides (#1323)Jon Dufresne2020-04-111-2/+2
| | | | | | 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'
* Add testing and support for PyPyjdufresne-pypyAndy McCurdy2020-04-094-1/+13
|\
| * Add testing and support for PyPyJon Dufresne2020-04-044-1/+12
| |
* | Use setuptools setup.cfg declarative configuration (#1316)Jon Dufresne2020-04-092-44/+35
| | | | | | | | | | | | | | | | | | 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.
* | Fix typo: occured → occurred (#1315)Jon Dufresne2020-04-091-4/+4
|/
* Lock.extend() can now replace the lock's existing TTL with a new valuelaixintao2020-03-243-14/+46
| | | | | | | 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`.
* constant for redis 6 RC candidates in tests.Andy McCurdy2020-03-123-20/+26
| | | | replace with a '6.0.0' literal when Redis 6 is GA
* add keepttl option to set command.laixintao2020-03-123-1/+19
| | | | | fixes #1304 fixes #1280
* Clear pipeline watch state after execNick Gaya2020-03-106-22/+66
|
* Don't send DISCARD after ExecAbortError in pipelineNick Gaya2020-03-103-2/+17
| | | | | | | 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.
* doc: fix changes of `hset`.(incorrect version) (#1297)赖信涛2020-03-031-2/+2
| | | fix: https://github.com/andymccurdy/redis-py/issues/1296
* mark test_spop_multi_value as needing server 3.2.0 or greaterAndy McCurdy2020-03-031-0/+1
| | | | fixes #1298
* add support for the MEMORY STATS commandAndy McCurdy2020-02-252-3/+42
| | | | Fixes #1268
* Support memoryview encoding/decoding as a no-opCody-G2020-02-244-12/+75
| | | | | | | | | | 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
* Optimize sleeping while blocking for a lockColas Le Guernic2020-02-243-9/+23
| | | | | | | | | 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
* Add a documentation note about calling `pipe.multi()` prior to write commandsAndy McCurdy2020-02-241-0/+3
| | | | Fixes #1279
* expand AUTH fallback support to pre-v6 Redis servers.Andy McCurdy2020-02-122-0/+8
| | | | Ref #1274
* Stop hiding errors that occur inside __del__ methodsJon Dufresne2020-02-123-24/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Drop unused variables and imports (#1284)Jon Dufresne2020-02-123-4/+3
|
* Enable warnings during tests and fix discovered cases (#1283)Jon Dufresne2020-02-122-3/+5
| | | | | | 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.
* Improve Redis.hmset() warning messageJon Dufresne2020-02-122-14/+21
| | | | | | | | | 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 support multiple field/value pairs. (#1271)赖信涛2020-02-073-5/+34
| | | | | | | | | | | | * 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>
* 3.4.13.4.1Andy McCurdy2020-02-012-2/+8
|
* remove Redis and ConnectionPool __eq__ comparisonAndy McCurdy2020-02-014-80/+0
| | | | | | | | | | | | | 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
* Move the username argument in the Redis and Connection classes to the endAndy McCurdy2020-01-313-8/+10
| | | | | | | This helps those poor souls that specify all their connection options as non-keyword arguments. Fixes #1276
* Provide AUTH fallback support for connection URLs with a username componentAndy McCurdy2020-01-314-1/+34
| | | | | | | | | | | | | 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
* 3.4.03.4.0Andy McCurdy2020-01-302-2/+2
|