| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove support for end-of-life Python 2.7
Python 2.7 is end of life. It is no longer receiving bug fixes,
including for security issues. Python 2.7 went EOL on 2020-01-01. For
additional details on support Python versions, see:
Supported: https://devguide.python.org/#status-of-python-branches
EOL: https://devguide.python.org/devcycle/#end-of-life-branches
Removing support for EOL Pythons will reduce testing and maintenance
resources while allowing the library to move towards a modern Python 3
style. Python 2.7 users can continue to use the previous version of
redis-py.
Was able to simplify the code:
- Removed redis._compat module
- Removed __future__ imports
- Removed object from class definition (all classes are new style)
- Removed long (Python 3 unified numeric types)
- Removed deprecated __nonzero__ method
- Use simpler Python 3 super() syntax
- Use unified OSError exception
- Use yield from syntax
Co-authored-by: Andy McCurdy <andy@andymccurdy.com>
|
|
|
|
|
|
|
|
|
| |
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))
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
| |
check exception.args rather than exception.message. exception.message
was deprecated prior to Python 2.7 and some alternative builds have
removed it completely.
|
|
|
|
|
|
|
|
|
| |
Fix SSL regression introduced in 3.3.9
The wrapper introduced to handle SSL timeout errors in Python 2.7
incorrectly assumed that instances of SSLError would always have a
string as their first element. The safer approach is to check the
message attribute on the error.
|
|
|
|
|
|
|
|
|
| |
Fixes SSL read timeouts in Python 2.7
The ssl module in Python 2.7 raises timeouts as ssl.SSLError instead of
socket.timeout. When these timeouts are encountered, the error will be
re-raised as socket.timeout so it is handled appropriately by the
connection.
|
|
|
|
|
|
|
| |
This replaces the work in 3.2.0 to use nonblocking sockets instead of
selectors. Selectors proved to be problematic for some environments
including eventlet and gevent. Nonblocking sockets should be available
in all environments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds redis.selector, a module that provides the best selector strategy
available on the current platform. A redis.selector polls a socket to
provide two pieces of functionality:
1. Check whether data can be read from the socket. Prior versions of redis-py
provided this behavior with just select.select(). select() has lots of
limitations, most notably a limit of ~1024 file descriptors. Now that
better selectors are available, this should make can_read() faster and
able to accomodate more clients. See #1115 and #486
2. Check whether a socket is ready for a command to be sent. This doubles
as a health check. It ensures that the socket is available for writing,
has no data to read and has no known errors. Anytime a socket is
disconnected or hung up, data is available to be read, typically zero bytes.
ConnectionPool.get_connection has been modified to ensure that connections
it returns are connected and are ready for a command to be sent. If
get_connection encounters a case where a socket isn't ready for a command
the connection is reconnected and checked again.
TODO: more tests for this stuff. implement EPoll and KQueue selectors.
Fixes #1115
Fixes #486
|
|
|
|
|
|
| |
Both Python 2.7 & Python 3 have the types bytes. On Python 2.7, it is an
alias for the type str, same as what was previously defined in
_compat.py.
|
|\ |
|
| |
| |
| |
| | |
Remove workaround for handling unicode with older Pythons.
|
| |
| |
| |
| | |
Available on all supported Python versions.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
| |
Remove InterruptedError in favor of using select.error. Support for the
2.7 series requires this because InterruptedError was not introduced
until Python 3.3.
|
| |
|
| |
|
|
|
| |
Fixes #845
|
|
|
|
| |
Ref #738
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
combination with msgpack and lua
|
|
|
|
|
|
|
| |
StrictRedis.from_url() now creations a connection pool instance and
passes that as the connection_pool argument to the client class.
Cleaned up the test suite for URL parsing and BlockingConnectionPool tests
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Adds python 2.5 support for the LifoQueue structure.
|
| |
|
| |
|
|
|
| |
previous commit
|
|
|