#33061: ValueError not raised for incr / decr with negative delta for some
backends?
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Chris Jerdonek:
Old description:
> I was looking at the code for some of the cache backends, and I noticed
> that in a couple places, it looks like `ValueError` isn't being raised
> when it should be. This is in the
> [https://github.com/django/django/blob/3445c50a3affc5ae7b1c2712a139d4a5105aeaf5/django/core/cache/backends/memcached.py#L111-L112
> incr()] and
> [https://github.com/django/django/blob/3445c50a3affc5ae7b1c2712a139d4a5105aeaf5/django/core/cache/backends/memcached.py#L128-L129
> decr()] methods of `BaseMemcachedCache` when `delta` is less than zero.
> The commit where this code was added is here:
> https://github.com/django/django/commit/79dd751b0b9e428bf386d7304f442fa9815fdbba
New description:
I was looking at the code for some of the cache backends, and I noticed
that in a couple places, it looks like `ValueError` isn't being raised
when it should be. This is in the
[https://github.com/django/django/blob/3445c50a3affc5ae7b1c2712a139d4a5105aeaf5/django/core/cache/backends/memcached.py#L111-L112
incr()] and
[https://github.com/django/django/blob/3445c50a3affc5ae7b1c2712a139d4a5105aeaf5/django/core/cache/backends/memcached.py#L128-L129
decr()] methods of `BaseMemcachedCache` when `delta` is less than zero.
The commit where this code was added is here:
https://github.com/django/django/commit/79dd751b0b9e428bf386d7304f442fa9815fdbba
This is just by looking at the code, so I could be wrong. But I wanted to
flag it.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33061#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.99e8b8dec8deb00d5593d726863de58b%40djangoproject.com.