summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Prepare the version 3.1.0 release (#278)v3.1.0Jon Parise2020-04-095-5/+11
|
* Add TLS support for TCP sockets (#276)Moisés Guimarães de Medeiros2020-04-0710-6/+192
|
* Fix corner case with dead server coming back alive (#275)Lukasz Czaplinski2020-04-042-14/+58
| | | | | Looks like clients/hash behaves incorrectly when dead server comes back alive - it's never removed from dead_clients and thus retried indefinitely. Failing test and fix are visible in 35ee9de, rest of PR simply adds some test coverage and refactors existing code a little.
* Merge pull request #274 from jparise/3.0.1v3.0.1Charles Gordon2020-03-202-1/+7
|\ | | | | Prepare the version 3.0.1 release
| * Prepare the version 3.0.1 releaseJon Parise2020-03-202-1/+7
|/
* Update MockMemcacheClient to reuse check_key (#273)Joe Gordon2020-03-194-25/+22
| | | | | | | | Our current MockMemcacheClient doesn't throw an error if a key has a space, and given MockMemcacheClient can be consumed by downstream things, we want it to act as close to the real client as possible. Rename _check_key to check_key_helper so we aren't importing a private function.
* HashClient pass encoding servers (#271)Doug2020-03-182-0/+28
| | | pass the encoding from the hashed client to the pooled client when use_pooling is True.
* Add Feras to the contributors listJon Parise2020-01-151-0/+1
|
* Enforcing consistency between the client mock and real client so… (#268)Feras Alazzeh2020-01-151-1/+3
|
* adding clear method to MockMemcacheClient (#266)Feras Alazzeh2020-01-071-0/+4
|
* Start the version 3.0.0 release process (#265)v3.0.0Jon Parise2020-01-022-11/+11
| | | | This code is in good shape for our next major release so this just updates the changelog and package version.
* Add touch method to HashClient (#264)Jon Parise2019-12-223-0/+36
|\ | | | | Add touch method to HashClient
| * Fix linter errorsAli-Akber Saifee2019-12-212-1/+1
| |
| * Add touch method to HashClient (#263)Ali-Akber Saifee2019-12-213-0/+36
|/
* Add prepend and append support to MockMemcacheClient (#261)Joe Gordon2019-12-172-0/+34
| | | | So that MockMemcacheClient is more complete and can be used for testing prepend and append cases.
* Add official support for Python 3.8 (#262)Jon Parise2019-12-173-4/+5
|
* trivial: update library name (#259)Lance Bragstad2019-11-251-3/+3
| | | | | | I was reading through the documentation and noticed a minor inconsistency in the naming of the python-memcached library. This commit updates the library name to reflect the real library we're referencing.
* Clarify noreply + self.default_noreply behavior (#255)Jon Parise2019-09-101-6/+10
| | | | | For add(), replace(), cas(), and delete(), if noreply is True (or if it is unset and self.default_noreply is True), the return value is always True.
* Rename CI workflow to "CI"Jon Parise2019-09-101-1/+1
|
* Rename tests.yml -> ci.yml for clarityJon Parise2019-09-051-0/+0
|
* Remove the max-parallel CI restrictionJon Parise2019-09-031-2/+1
|
* Remove Travis CI badge from READMEJon Parise2019-09-031-3/+0
|
* Switch to GitHub Actions (#252)Jon Parise2019-09-032-27/+44
| | | | | | | | | | | | GitHub Actions profiles a nicer alternate to Travis for running continuous integration jobs. One compromise I've made in this migration is moving away from using `tox` to run tests in our CI environment. We were previously relying on the tox-travis to bridge between Travis' build matrix and tox's environment list. At the moment, there doesn't appear to be an equivalent for GitHub actions. Once there is one, we can consider switching to it so that local and CI uses the same test runner.
* Validate cas inputs as strings of digits (#250)Stephen Rosen2019-08-264-6/+54
| | | | | | | | | | | | | | | | | | | | For consideration for v3.0.0 'cas' is documented as needing to be an int or bytestring of the digits 0-9. However, this is not actually enforced and it is possible to pass a value to pymemcache which doesn't conform to these rules. In fact, you can do weird things like `cas=b'noreply'` and potentially trigger "unexpected" behavior. To go along with validating int inputs, validate cas inputs. However, these are not necessarily integers. Instead, if an int or string is given, it will be encoded as a bytestring. But in order to validate the value given, it is checked against isdigit() . (NB: You could also use `int(cas)` for very similar checking.) Rationale for allowing non-integer inputs to cas is not obvious. Presumably it allows callers using `gets()` to pass the `cas` value they get back into a `cas` command without issue. But it may be debatable.
* Change serialization interface to be an object (#245)Stephen Rosen2019-08-2610-109/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Inaugurate pymemcache 3.0 developmentJon Parise2019-08-203-9/+9
|
* Check integer input values to Client methods (#243)Stephen Rosen2019-08-203-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a caller tries to send - a fractional expiration time - a string for the "incr" command - delay=None (instead of delay=0) The pymemcache base client will now catch these usage mistakes a throw a MemcacheIllegalInputError. Although there are existing valid (but undocumented) usages of the current string conversion behavior, the docs state that these values are supposed to be ints. Now if a non-int value is used, it will immediately trigger an error. This behavior is superior to the prior behavior especially in the case where a command is used with `noreply=True`. It can fail to parse, but the client won't pick up on this until the next call to memcache which reads the reply. The especially bad case we're seeking to avoid is this: from pymemcache.client.base import Client client = Client(("localhost", 11211)) client.set("foo", "bar", expire=1.5, noreply=True) client.get("foo") # triggers MemcacheUnknownCommandError Applies to all commands using `expire`, `delay`, incr and decr inputs, and memlimit. Because this is can be a breaking change for some users, the changelog entry is written under 3.0.0 (unreleased). closes #240
* Fix long_description string in Python packaging (#249)v2.2.2Jon Parise2019-08-065-9/+11
| | | | | When defining `long_description` in setup.cfg using the `file:` directive, we need to keep everything on one line. Otherwise, it will treat the value as a block of literal text.
* Fix flags when setting multiple values at once (#248)v2.2.1Jon Parise2019-08-054-10/+47
| | | | | | | | | | | | | | | | | | | | | We introduced the ability to override the serializer-returned flags values in 26f7c1b1. Unfortunately, there was a flaw in that logic which resulted in the first item's flags being used for all later items. This bug primarily affected set_many()'s behavior when the data dictionary contained multiple different value types which were assigned different per-value flags values by the serializer. For example: set_many({'a': 'string', 'b': 10}) If a serializer returned different flags for strings (e.g. 1) and integer values (e.g. 2), the previous logic would have set ``flags`` to 1 the first time through the loop and repeated that value for the second item, instead of using 2. This was the intended behavior when ``flags`` was explicitly passed to set_many(), but not for the default case where we still want to respect the flags values returned by the serializer.
* Add note about the overriding behavior of `flags` (#247)Jon Parise2019-08-011-4/+12
|
* Add Sphinx links to the exception classes (#246)Jon Parise2019-08-011-8/+8
|
* Set `long_description_content_type = text/x-rst`Jon Parise2019-07-301-0/+1
|
* Bump documentation version for 2.2.0 releasev2.2.0Jon Parise2019-07-301-2/+2
|
* Update changelog in preparation for v2.2.0 (#244)Jon Parise2019-07-301-2/+6
|
* Be more consistent about using Client.encoding (#242)Stephen Rosen2019-07-241-4/+6
| | | | | | | | | | | | | | This is a stylistic issue with little chance for actual impact. Some methods use 'ascii' verbatim and some use `self.encoding` (which defaults to 'ascii'). Those which are using `ascii` are only supposed to be accepting integer inputs, so this is actually fine. However, the result is a potentially confusing discrepancy -- why does `Client.touch` use `ascii` while `Client.add` uses `self.encoding`? To alleviate this potential confusion, be consistent about applying `self.encoding` to all memcached commands in the base client. This does not impact the `_check_key` func, which re-encodes potential unicode inputs as ASCII.
* Add noreply warning to getting_started doc (#241)Stephen Rosen2019-07-241-1/+13
| | | | | | | | | resolves #239 Add a warning to the Best Practices section of the Getting Started doc which explains the interaction between `noreply=True` and error handling. Also, fix a very minor typo, ``"noreply`` in a nearby line.
* Normalize the repository URL (#238)Jon Parise2019-07-051-1/+1
|
* extracted _extract_value() from _fetch_cmd() (#237)JianGuoPinterest2019-06-122-21/+68
| | | extract _extract_value() from _fetch_cmd() to support customized value extraction logic.
* add flags in client functions (#235)JianGuoPinterest2019-06-113-32/+75
| | | added flags in client functions to provide support for extra memcached operations.
* add encoding in client functions (#232)JianGuoPinterest2019-06-074-17/+120
|
* Drop official support for Python 3.4 (#234)Jon Parise2019-06-072-3/+0
| | | | Python 3.4 has reached end-of-life so remove it from the set of officially supported Python versions.
* Merge pull request #230 from jparise/changelog-2.2.0Joe Gordon2019-05-091-3/+5
|\ | | | | Update the changelog with recent changes
| * Update the changelog with recent changesJon Parise2019-05-091-3/+5
|/
* Merge pull request #228 from jparise/repr-quotesJoe Gordon2019-05-071-4/+4
|\ | | | | Remove redundant '' from %r values
| * Remove redundant '' from %r valuesJon Parise2019-05-071-4/+4
| | | | | | | | repr()'d strings (via %r) are already quoted.
* | Merge pull request #229 from jparise/ascii-encode-errorJoe Gordon2019-05-071-1/+2
|\ \ | |/ |/| Improve ASCII encoding failure exception
| * Improve ASCII encoding failure exceptionJon Parise2019-05-071-1/+2
|/ | | | | | Memcache can only store binary-safe values. We raise an exception when we're unable to encode a data value using the 'ascii' codec. Improve the exception message to make the error case clearer.
* Merge pull request #225 from cdonati/hash-default-noreplyJon Parise2019-04-191-1/+3
|\ | | | | Add default_noreply paramter to HashClient
| * Add default_noreply paramter to HashClientChris Donati2019-04-191-1/+3
|/ | | | | | This allows users to specify the noreply behavior upon creation of a HashClient like they are already able to do for Client and PooledClient.
* Merge pull request #223 from jogo/222Jon Parise2019-03-192-6/+9
|\ | | | | Handle unicode key values in MockMemcacheClient correctly