summaryrefslogtreecommitdiff
path: root/tests/test_encoding.py
Commit message (Collapse)AuthorAgeFilesLines
* Use hiredis::pack_command to serialized the commands. (#2570)Sergey Prokazov2023-02-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implemented pack command and pack bytes * 1) refactored the command packer construction process 2) now hiredis.pack_bytes is the default choice. Though it's still possible to run redisrs-py (fix the flag in utils.py) or hiredis.pack_command (flag in connection.py) * Switch to hiredis.pack_command * Remove the rust extension module. * 1) Introduce HIREDIS_PACK_AVAILABLE environment variable. 2) Extract serialization functionality out of Connection class. * 1) Fix typo. 2) Add change log entry. 3) Revert the benchmark changes * Ditch the hiredis version check for pack_command. * Fix linter errors * Revert version changes * Fix linter issues * Looks like the current redis-py version is 4.4.1 --------- Co-authored-by: Sergey Prokazov <sergey.prokazov@redis.com>
* Fix tests for Redis 7 (#2182)dvora-h2022-05-311-1/+1
| | | | | * fix tests * async
* update black to 22.3.0 (#2171)Utkarsh Gupta2022-05-301-5/+1
|
* Added black and isort (#1734)Anas2021-11-301-36/+45
|
* Remove support for end-of-life Python 2.7 (#1318)Jon Dufresne2020-08-061-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Support memoryview encoding/decoding as a no-opCody-G2020-02-241-1/+46
| | | | | | | | | | 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
* Pass encoding_errors setting to hiredis (>=1.0.0) (#1162)Brian Candler2019-05-291-0/+14
| | | | | Pass encoding_errors setting to hiredis (>=1.0.0). Fixes #1161
* remove Token class in favor of bytestringremove_tokenAndy McCurdy2019-05-281-1/+1
| | | | | | | The Token class was needed when supporting Python 2.6. Now that we've dropped support for 2.6, we don't need it anymore. Fixes #1066
* only accept bytes, strings, ints, longs and floats as user inputAndy McCurdy2018-11-141-7/+21
| | | | | | | | | | | | | | | | | All input sent to Redis is coerced into bytes. This includes key names and values. Prior to this change, redis-py made an effort to cooerce all input into strings by calling str() (Python 3) or unicode() (Python 2). While this works for a handful of types like ints, longs and floats, it fails for other types like bools ('True' or 'False'), None ('None') and many user defined types. Starting with redis-py version 3.0, sending input of any other type is considered an error an a DataError exception will be raised. Fixes #471 Fixes #472 Fixes #321 Fixes #190
* Use unicode literals throughout projectJon Dufresne2018-11-031-4/+5
| | | | Remove workaround for handling unicode with older Pythons.
* Remove from __future__ import with_statementJon Dufresne2018-11-031-1/+0
| | | | All supported Python versions support the with statement.
* avoid calling pytest fixtures directly since that's frowned uponAndy McCurdy2018-10-311-3/+4
|
* Fix warning during testJon Dufresne2017-01-281-1/+1
| | | | | | Fixes warning output: DeprecationWarning: "charset" is deprecated. Use "encoding" instead
* fix: Connection.encode complains when value is an object having unicode ↵Eric Du2015-05-041-0/+7
| | | | characters in its printable representation
* string literals no longer get encoded before being send to RedisAndy McCurdy2014-05-121-0/+9
| | | | | | | | | | | | previously all pieces of a command, including the command name and literal options to it (such as "WITHSCORES" on ZSET commands) would get encoded. this works fine on utf-8, but other encodings like utf-16 break. a new Token class has been introduced that command names and literal options get wrapped. the encoder falls back to the latin-1 encoding for these literals as they are all ascii. fixes #430
* with tox/travis, tests don't need to know about the environmentAndy McCurdy2014-01-281-14/+4
|
* encoding fixandy2013-06-071-1/+1
|
* encoding testsandy2013-06-061-0/+34