| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
https://github.com/psf/black/blob/main/CHANGES.md
Run latest version of black to fix formatting issues
|
|
|
|
|
|
|
|
|
|
| |
This test was written with the assumption
that sys.maxsize is equal to 2**63 - 1 everywhere.
sys.maxsize is equal to 2**31 - 1 on a 32-bit
platforms and 2**63 - 1 on a 64-bit platforms.
See also https://docs.python.org/3/library/sys.html#sys.maxsize
|
|
|
| |
Co-authored-by: Matej Spiller Muys <matej.spiller-muys@bitstamp.net>
|
| |
|
|\
| |
| | |
4.0.0 Release
|
| |
| |
| |
| | |
Update changelog and version
|
|/
|
|
|
|
|
| |
Add integration tests to reproduce the issue and add an argument to
_fetch_cmd to skip the key prefix logic as needed.
Closes #430
|
|\
| |
| | |
Add more type annotations
|
| |
| |
| |
| | |
Continue to improve the type annotation coverage
|
|/
|
|
|
| |
As per https://peps.python.org/pep-0561/ add a py.typed file to let
things like mypy there is inline typing information
|
|
|
|
|
| |
First pass at adding some type hints to pymemcache to make it easier to
develop against etc.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Basically ensure the client only does one pass over the buffer instead of two.
Exact thread: https://github.com/pinterest/pymemcache/pull/395#discussion_r890288417
|
|
|
|
| |
See https://github.com/pinterest/pymemcache/issues/396 for more details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A stat with a blank value makes the .stats() call fail with index error.
```
memcache_connection.stats()
File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 741, in stats
result = self._fetch_cmd(b'stats', args, False)
File "/lib/python3.6/site-packages/pymemcache/client/base.py", line 921, in _fetch_cmd
result[key_value[1]] = key_value[2]
IndexError: list index out of range
```
The line in question we saw that caused this:
```
b'STAT ep_initfile '
```
This fixes things to no longer blow up. I chose to use a blank binary string instead of None because I suspect other code might make assumptions about the data being binary strings due to this bug.
Co-authored-by: reecepeg <reecepeg@amazon.com>
|
|
|
|
|
| |
This also drops support for passing None as a server spec, which is
something many tests were doing out of lazy convenience. I can't think
of a reason why we'd want to support that for real world usage.
|
| |
|
|
|
|
|
| |
Black and its style guide are now officially stable. Future releases
will allow incremental adoption of new style changes via a new --preview
system.
|
|
|
|
|
|
|
| |
The regular client supports noreply so pass args, kwargs like for other
functions in hash client
Fixes issue #360
|
|
|
|
| |
https://black.readthedocs.io/en/stable/index.html
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using HashClient with ignore_exc, get would always return
None if no server is available and the default is passed as a
positional argument. The other clients return the default
value in this case. An earlier fix only had the desired effect when
passing default as a keyword argument.
For example, Django passes the default as a positional argument.
Return the default value so HashClient behaves like the other
clients.
|
| |
|
|
|
|
|
|
|
| |
ignore_exc should treat an error as a cache miss and default specifies
what should be returned on a miss.
Fixes issue #350
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| | |
* future was needed for some python 2 specific tests
* use mock from unittest.mock instead of the 3rd party mock library
|
| |
| |
| |
| |
| |
| |
| | |
Now that we don't require Python 2 support no need for six.
Code upgraded with pyupgrade and manual fixes to remove remaining six
usage.
|
|/ |
|
| |
|
|\
| |
| | |
Implement RetryingClient
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
During network maintenance operations or during server reboot users could
face MemcacheUnexpectedCloseError.
This kind of exception will be raised down the stack. It's a design
choice [1]. Users should manage this kind of exception.
However, at some points the opened sockets remains more or less opened
after this kind of fail on the client side [2]. It will require n+1
calls to see them recreated when the connection will be possible. That's
could be problem with services that implement several cache logics in parallel
and where their clients are based on pymemcache.
These changes simply ensure to close the socket properly. The socket
will be recreated by the client if needed.
[1] https://github.com/pinterest/pymemcache/issues/307
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1977711
|
| |
| |
| |
| |
| |
| |
| |
| | |
The _store_cmd method became a bit to complexe and the linter complains
when we add new conditions or try/except clause.
These changes outsource some some processsing to reduce the complexity
of the method.
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
9551dfd0 introduced a call to socket.getaddrinfo() to support IPv6, but
we never added an implementation of that function to MockSocketModule.
This resulted in some tests making "live" socket.getaddrinfo() calls
because of the default MockSocketModule.__getattr__ implementation
(which we need to forward other module attribute lookups).
|
| |
|
|
|
|
|
|
| |
The Memcached server can be configured to drop idle connections (via the
idle_timeout option). When this occurs, pymemcache may still try to
use the connection, resulting in MemcacheUnexpectedCloseError. Hence
the need for client-side idle timeout logic.
|
| |
|