<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pymemcache.git/pymemcache/test/utils.py, branch github-actions</title>
<subtitle>github.com: pinterest/pymemcache.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/'/>
<entry>
<title>Change serialization interface to be an object (#245)</title>
<updated>2019-08-26T18:11:31+00:00</updated>
<author>
<name>Stephen Rosen</name>
<email>sirosen@globus.org</email>
</author>
<published>2019-08-26T18:11:31+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=5699c9dfa7067a99000e281091dd6400a1e84122'/>
<id>5699c9dfa7067a99000e281091dd6400a1e84122</id>
<content type='text'>
* Change serialization interface to be an object

Rather than passing separate serialization and deserialization methods
to a pymemcache client, pass an object implementing a very simple
two-method interface.

This is a rather significant breaking change and should be part of an
x.0.0 major release.

Resolves #56

As suggested in that issue, this is a cleaner interface, as there's no
sensible context in which you would provide only one of these two
methods and it should therefore be thought of as a
serialization/deserialization protocol.

Also adds a note to the documentation's Best Practices list that you
should use the built-in serializer object unless you have a reason to do
otherwise.

* Support "de/serializer" in addition to "serde"

In order to support older client usage in addition to the new
serialization object (protocol), restore the "serializer" and
"deserializer" arguments to the Client classes.
These are marked as deprecated and will be automatically wrapped into a
small "serde" object.

In order to make the various object names more distinguishable and more
informative, the built-in default serializer is now called
"python_memcache_pickle_serde"

Additionally, default client.serde to a "no-op serializer".
This object does no transforms on the data. By putting this in place, we
can skip some conditionals in the code around presence or absence of a
serializer and therefore simplify internally (at the cost of an extra,
unnecessary, functional call in some cases).

It also simplifies logic around the handling of flags because we are now
*guaranteed* the presence of a serializer object which returns some
flags. i.e. "default flags" are no longer the responsibility of the
various serializer usage sites.
This is done carefully to ensure that passing a `serializer` without a
`deserializer` is respected.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Change serialization interface to be an object

Rather than passing separate serialization and deserialization methods
to a pymemcache client, pass an object implementing a very simple
two-method interface.

This is a rather significant breaking change and should be part of an
x.0.0 major release.

Resolves #56

As suggested in that issue, this is a cleaner interface, as there's no
sensible context in which you would provide only one of these two
methods and it should therefore be thought of as a
serialization/deserialization protocol.

Also adds a note to the documentation's Best Practices list that you
should use the built-in serializer object unless you have a reason to do
otherwise.

* Support "de/serializer" in addition to "serde"

In order to support older client usage in addition to the new
serialization object (protocol), restore the "serializer" and
"deserializer" arguments to the Client classes.
These are marked as deprecated and will be automatically wrapped into a
small "serde" object.

In order to make the various object names more distinguishable and more
informative, the built-in default serializer is now called
"python_memcache_pickle_serde"

Additionally, default client.serde to a "no-op serializer".
This object does no transforms on the data. By putting this in place, we
can skip some conditionals in the code around presence or absence of a
serializer and therefore simplify internally (at the cost of an extra,
unnecessary, functional call in some cases).

It also simplifies logic around the handling of flags because we are now
*guaranteed* the presence of a serializer object which returns some
flags. i.e. "default flags" are no longer the responsibility of the
various serializer usage sites.
This is done carefully to ensure that passing a `serializer` without a
`deserializer` is respected.</pre>
</div>
</content>
</entry>
<entry>
<title>add flags in client functions (#235)</title>
<updated>2019-06-11T21:36:44+00:00</updated>
<author>
<name>JianGuoPinterest</name>
<email>51248389+JianGuoPinterest@users.noreply.github.com</email>
</author>
<published>2019-06-11T21:36:44+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=26f7c1b1371e86b0aab7f640af980a59df1ec098'/>
<id>26f7c1b1371e86b0aab7f640af980a59df1ec098</id>
<content type='text'>
added flags in client functions to provide support for extra memcached operations.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
added flags in client functions to provide support for extra memcached operations.</pre>
</div>
</content>
</entry>
<entry>
<title>add encoding in client functions (#232)</title>
<updated>2019-06-07T22:29:14+00:00</updated>
<author>
<name>JianGuoPinterest</name>
<email>51248389+JianGuoPinterest@users.noreply.github.com</email>
</author>
<published>2019-06-07T22:29:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=f23602c176f72cda367f618f20e0c89940431130'/>
<id>f23602c176f72cda367f618f20e0c89940431130</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle unicode key values in MockMemcacheClient correctly</title>
<updated>2019-03-19T17:58:09+00:00</updated>
<author>
<name>Joe Gordon</name>
<email>jogo@pinterest.com</email>
</author>
<published>2019-03-19T17:58:09+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=7ea947d8cd489129363ffa215987ff296d9b7b24'/>
<id>7ea947d8cd489129363ffa215987ff296d9b7b24</id>
<content type='text'>
The actual client tries to encode unicode and if it fails
MemcacheIllegalInputError is raised. Fix the MockMemcacheClient to do
the same thing.

Fix bug #222
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The actual client tries to encode unicode and if it fails
MemcacheIllegalInputError is raised. Fix the MockMemcacheClient to do
the same thing.

Fix bug #222
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix support newbytes from future</title>
<updated>2018-09-07T00:38:30+00:00</updated>
<author>
<name>Joe Gordon</name>
<email>jogo@pinterest.com</email>
</author>
<published>2018-09-07T00:08:04+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=9ed0caa19ac3843c3449e2d4603bc0ec9327b2a1'/>
<id>9ed0caa19ac3843c3449e2d4603bc0ec9327b2a1</id>
<content type='text'>
Previously python2 code using python-future to backport the py3 bytes
behavior would trigger the following exception:

code:

  from builtins import bytes as newbytes
  from pymemcache.client.base import Client
  client = Client(('localhost', 11211))
  client.set(newbytes('key'), 'value')

  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 297, in set
      return self._store_cmd(b'set', key, expire, noreply, value)
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 770, in _store_cmd
      key = self.check_key(key)
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 251, in check_key
      key_prefix=self.key_prefix)
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 91, in _check_key
      key = key.encode('ascii')
    File "/usr/local/lib/python2.7/site-packages/future/types/newbytes.py", line 381, in __getattribute__
      raise AttributeError("encode method has been disabled in newbytes")
  AttributeError: encode method has been disabled in newbytes

Add a test case for this and fix.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously python2 code using python-future to backport the py3 bytes
behavior would trigger the following exception:

code:

  from builtins import bytes as newbytes
  from pymemcache.client.base import Client
  client = Client(('localhost', 11211))
  client.set(newbytes('key'), 'value')

  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 297, in set
      return self._store_cmd(b'set', key, expire, noreply, value)
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 770, in _store_cmd
      key = self.check_key(key)
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 251, in check_key
      key_prefix=self.key_prefix)
    File "/usr/local/lib/python2.7/site-packages/pymemcache/client/base.py", line 91, in _check_key
      key = key.encode('ascii')
    File "/usr/local/lib/python2.7/site-packages/future/types/newbytes.py", line 381, in __getattribute__
      raise AttributeError("encode method has been disabled in newbytes")
  AttributeError: encode method has been disabled in newbytes

Add a test case for this and fix.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix test</title>
<updated>2018-07-09T10:31:48+00:00</updated>
<author>
<name>opapy</name>
<email>opapy.worker@gmail.com</email>
</author>
<published>2018-07-09T10:31:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=b18ce057ed0f0c54c6a6e4159f1f125e102fc680'/>
<id>b18ce057ed0f0c54c6a6e4159f1f125e102fc680</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Have MockMemcacheClient support non-ascii strings (#169)</title>
<updated>2017-11-19T15:06:17+00:00</updated>
<author>
<name>Edward Lim</name>
<email>lime.sbu@gmail.com</email>
</author>
<published>2017-11-19T15:06:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=dd75ccc0d74aecb09039ad536f04e63a82dea847'/>
<id>dd75ccc0d74aecb09039ad536f04e63a82dea847</id>
<content type='text'>
Allow binary strings to be stored as-is in MockMemcachedClient

The current MockMemcacheClient doesn't support storage of non-ascii strings as values, but the real Client does. This PR aims to close this gap between the mock and real clients.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow binary strings to be stored as-is in MockMemcachedClient

The current MockMemcacheClient doesn't support storage of non-ascii strings as values, but the real Client does. This PR aims to close this gap between the mock and real clients.</pre>
</div>
</content>
</entry>
<entry>
<title>Add optional support for unicode keys</title>
<updated>2016-11-03T16:52:53+00:00</updated>
<author>
<name>Joe Gordon</name>
<email>jogo@pinterest.com</email>
</author>
<published>2016-10-31T21:04:00+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=3613587536673154b45dbb8fe482e736f13a3a36'/>
<id>3613587536673154b45dbb8fe482e736f13a3a36</id>
<content type='text'>
memcached's ASCII protocol supports unicode keys, so lets support them
as well. Since using unicode keys for memcache is uncommon and to
preserve the previous behavior disable support by default.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
memcached's ASCII protocol supports unicode keys, so lets support them
as well. Since using unicode keys for memcache is uncommon and to
preserve the previous behavior disable support by default.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #117, illegal unicode character in middle of key (or value now)</title>
<updated>2016-10-03T21:31:14+00:00</updated>
<author>
<name>Nicholas Charriere</name>
<email>nicholas@pinterest.com</email>
</author>
<published>2016-10-03T18:31:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=a1bf081754cd38de1a20925782a5404de00bd46d'/>
<id>a1bf081754cd38de1a20925782a5404de00bd46d</id>
<content type='text'>
Add .python-version to .gitignore (for pyenv)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add .python-version to .gitignore (for pyenv)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix the MockMemcacheClient implementation</title>
<updated>2016-09-19T14:49:12+00:00</updated>
<author>
<name>Suhail Patel</name>
<email>me@suhailpatel.com</email>
</author>
<published>2016-09-19T14:49:12+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pymemcache.git/commit/?id=1291a140f8604bdf9dcfdd370101b2e6a98dca32'/>
<id>1291a140f8604bdf9dcfdd370101b2e6a98dca32</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
