summaryrefslogtreecommitdiff
path: root/memcache.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow keys to be encoded before use.Sean Reifschneider2023-04-181-18/+27
| | | | | | | | | | Ported patch in #52 from @harlowja to current branch. Added tests. For the cases where the user wants to transparently encode keys (say using urllib) before they are used further allow a encoding function to be passed in that will perform these types of activities (by default it is the identity function).
* Merge branch 'master' into masterSean Reifschneider2023-04-171-70/+77
|\
| * Adding test for quit_allSean Reifschneider2023-04-161-3/+2
| |
| * Merge pull request #15 from userrl/masterSean Reifschneider2023-04-161-0/+22
| |\ | | | | | | Added quit() method. This method sends the 'quit' command to the servers and then closes the connections, reducing the number of TIME_WAIT sockets hanging around the OS.
| | * Added docstring/comments to _Host.quit(), renamed Client.quit() to ↵Russell2013-09-031-1/+13
| | | | | | | | | | | | Client.quit_all().
| | * Added quit() method.Russell2013-08-291-0/+10
| | |
| * | Removing "time" from delete and making expiry mandatory in touch.Sean Reifschneider2023-04-161-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of erankor's PR #30 to the latest code. In that PR, the "time" argument to delete() is removed because it is not supported by the protocol: https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L330 And touch requires the expiry parameter due to protocol: https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L399
| * | Removing six.PY2/3 conditionalsSean Reifschneider2023-04-151-29/+8
| | |
| * | Merge branch 'master' into fix-crc-0-hashSean Reifschneider2023-04-151-24/+27
| |\ \
| | * \ Merge pull request #155 from sergiimk/fix_multi_with_tuple_keysSean Reifschneider2023-04-151-2/+0
| | |\ \ | | | | | | | | | | Fix tuple key support in multi methods (regression in 1.55).
| | | * | Fix tuple key support in multi methodsSergii Mikhtoniuk2018-11-301-2/+0
| | | | | | | | | | | | | | | | | | | | Fixes: #154
| | * | | Merge branch 'master' into support_defaultSean Reifschneider2023-04-151-19/+23
| | |\ \ \
| | | * | | Cleaning up some flake8 warnings.Sean Reifschneider2023-04-151-10/+11
| | | | | |
| | | * | | Decoding in slab funcs, replacing "1" with "True" in while.Sean Reifschneider2023-04-151-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The slab functions needed a decode (as noted in https://github.com/linsomniac/python-memcached/pull/175), adapted that patch. Also converted "while 1" to "while True" while I was in there.
| | | * | | Removing a spurious backslash in a docstring, re PR #178Sean Reifschneider2023-04-151-1/+1
| | | | | |
| | | * | | Use == as suggested by Python 3.8za2022-09-191-2/+2
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` <snap>/python_memcached-1.59-py3.8.egg/memcache.py:1303: SyntaxWarning: "is" with a literal. Did you mean "=="? if key is '': <snap>/python_memcached-1.59-py3.8.egg/memcache.py:1304: SyntaxWarning: "is" with a literal. Did you mean "=="? if key_extra_len is 0: ```
| | * | | Fix linter errorsJakub Szafrański2019-02-121-1/+2
| | | | |
| | * | | Add support for default value in getJakub Szafrański2019-02-121-4/+4
| | |/ /
| * | | Fix cmemcahe_hash 0 values being translated to 1Chow Loong Jin2018-11-121-1/+1
| |/ /
* | | minor flake8 errorsTheo Massard2018-06-261-1/+4
| | |
* | | Allow to use a datetime.timedelta parameter for Client.setTheo Massard2018-06-261-1/+4
|/ / | | | | | | Closes #145
* | Updating version in .py fileSean Reifschneider2017-12-151-1/+1
| |
* | Updating version in .py fileSean Reifschneider2017-12-151-1/+1
| |
* | Fix touch(..., time=0) sending invalid command to memcacheNicolas Noé2017-11-211-1/+1
| | | | | | | | Without the trailing '0', the command is invalid.
* | Fix #79, #80 -- Fix storing non-ASCII values on Python 2 and binary values ↵Nicolas Noé2017-11-141-9/+13
| | | | | | | | on Python 3
* | Fix crash on Python 3 in touch() loggingMatt Davis2017-11-141-1/+1
| |
* | Fix key ordering failure in doctestsTim Graham2017-11-011-7/+6
| |
* | Fix typo in get_multi() docstringCharles Chan2017-10-301-1/+1
| |
* | #112 Cleaning up flake8 alertsSean Reifschneider2016-12-171-2/+3
| |
* | Add flake8 check to TravisTim Graham2016-12-171-6/+6
| |
* | Merge pull request #111 from timgraham/has_unicodeSean Reifschneider2016-12-171-11/+0
|\ \ | | | | | | Remove unused _has_unicode/_str_cls vars
| * | Remove unused _has_unicode/_str_cls varsTim Graham2016-12-161-11/+0
| | | | | | | | | | | | Unused since 04f1c78c13bd54050b1d2d3baa9e86d9e79b3629.
* | | Merge pull request #113 from timgraham/returnSean Reifschneider2016-12-171-8/+5
|\ \ \ | | | | | | | | Remove unnecessary parentheses in return statements
| * | | Remove unnecessary parentheses in return statementsTim Graham2016-12-161-8/+5
| |/ /
* | | Fix some typos in docstringsRomuald Brunet2016-12-011-7/+7
|/ /
* | Readme changes for delete() time=None changeSean Reifschneider2016-05-271-3/+3
| |
* | Merge pull request #82 from dieselmachine/72-version-discrepanciesSean Reifschneider2016-05-271-1/+1
|\ \ | | | | | | (#72) setup.py will now pull the version number directly from memcach…
| * | (#72) setup.py will now pull the version number directly from memcache.py ↵JT2015-10-011-1/+1
| | | | | | | | | | | | (using setuptools.depends.get_module_constant) in order to prevent discrepancies
* | | Merge pull request #91 from bartTC/masterSean Reifschneider2016-05-271-2/+2
|\ \ \ | | | | | | | | Python3: `get_stats` function fails due to Bytestring encoding errors
| * | | Fixed Python3 Bytestring decoding error in get_stats.Martin Mahner2016-03-191-2/+2
| |/ /
* | | Merge pull request #93 from grg350/masterSean Reifschneider2016-05-271-0/+31
|\ \ \ | | | | | | | | Adding support for "stats slabs" statistics
| * | | fixing indentation 2grg3502016-05-091-1/+1
| | | |
| * | | fixing indentationgrg3502016-05-091-1/+1
| | | |
| * | | Adding support for "stats slabs" statisticsraj.gurung2016-05-091-0/+31
| |/ /
* | | Use cPickle with Python 2 again, to fix v1.54 performance regressionEd Morley2016-01-071-1/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some Python 3 compatibility changes made python-memcached import pickle rather than cPickle, since the latter isn't available on Python 3: https://github.com/linsomniac/python-memcached/commit/45403325e0249ff0f61d6ae449a7daeeb7e852e5 This is fine on Python 3, since importing pickle will automatically use the faster C implementation if available, however with Python 2 this caused a 400% slowdown in memcache gets between python-memcached v1.53 and v1.54, when dealing with objects other than bytes. This mostly fixes #71, though there is still a 10-20% performance drop using current master plus this change compared to v1.53 (using Python 2.7.10).
* | Merge branch 'py3' of ssh://github.com/haypo/python-memcached into haypo-py3Sean Reifschneider2015-08-021-245/+28
|\ \ | | | | | | | | | | | | Conflicts: tests/test_memcache.py
| * | More Python 3 fixesVictor Stinner2015-07-271-245/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Port set_multi() to Python 3 * Port delete_multi() to Python 3 * Fix _get_server() on Python 3 when the connection to the first server fails: encode to ASCII before calling serverHashFunction. * Fix expect(): don't decode line on Python 3, return the raw line * Add more unit tests * tox now also runs unit tests * Explicit the encoding when calling str.encode(): use 'utf-8' * test_memcache: close sockets in tearDown() * test_get_unknown_value(): delete the key to ensure that it doesn't exist
* | | Fix for value being boolean in set().release-1.57Sean Reifschneider2015-07-311-2/+2
|/ /
* | Updating version in memcache.pySean Reifschneider2015-07-261-1/+1
| |
* | Port memcache to Python 3Victor Stinner2015-04-231-89/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * travis: make python 3 tests voting (cannot fail anymore) * setup.py: add Python 3 classifiers * Encode unicode key to UTF-8: add _encode_key() method * Add _encode_cmd() helper method to format a memcache command as a byte string (bytes%args will only be supported in Python 3.5) * Rewrite _map_and_prefix_keys() code converting keys * _val_to_store_info() now accepts Unicode: Unicode is encoded to UTF-8 * _set('cas') doesn't call _val_to_store_info() anymore when it's not needed: begin by checking if the key is in the cas_ids dictionary * Process server reply as bytes * _recv_value() now clears the _FLAG_COMPRESSED flag after decompressing to simplify the code * On Python 3, _recv_value() now decodes byte strings from UTF-8 * Simplify check_key(), _encode_key() now encodes Unicode to UTF-8 * Replace u'...' with six.u('...') in tests for Python 3.2