Skip to content

Commit 04f1c78

Browse files
committed
Port memcache to Python 3
* 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
1 parent 48e8827 commit 04f1c78

File tree

5 files changed

+158
-101
lines changed

5 files changed

+158
-101
lines changed

.travis.yml

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ python:
66
- 3.3
77
- 3.4
88
- pypy
9-
matrix:
10-
allow_failures:
11-
- python: 3.2
12-
- python: 3.3
13-
- python: 3.4
149
services:
1510
- memcached
1611
install: python setup.py install

0 commit comments

Comments
 (0)