Skip to content

fix: accept and ignore close() kwargs from request_finished signal (#…#818

Open
mpasternak wants to merge 2 commits into
jazzband:masterfrom
mpasternak:master
Open

fix: accept and ignore close() kwargs from request_finished signal (#…#818
mpasternak wants to merge 2 commits into
jazzband:masterfrom
mpasternak:master

Conversation

@mpasternak
Copy link
Copy Markdown

…787)

RedisCache.close() was forwarding **kwargs to self.client.close(), which since django-redis 6.0.0 (DefaultClient signature change in c7be6cc) takes no arguments. Django's request_finished signal passes signal= and sender=, so every request raised
TypeError: close() got an unexpected keyword argument 'signal'.

Also bumps the package to 6.0.1 and refreshes the CI/setup matrix: drop EOL Python 3.9/3.10 and Django 4.2/5.1; add Python 3.14 and Django 6.0 (Django 6.0 excluded on Python 3.11).

Fix #787

mpasternak and others added 2 commits April 26, 2026 21:22
…azzband#787)

`RedisCache.close()` was forwarding `**kwargs` to `self.client.close()`,
which since django-redis 6.0.0 (DefaultClient signature change in
c7be6cc) takes no arguments. Django's `request_finished` signal passes
`signal=` and `sender=`, so every request raised
`TypeError: close() got an unexpected keyword argument 'signal'`.

Also bumps the package to 6.0.1 and refreshes the CI/setup matrix:
drop EOL Python 3.9/3.10 and Django 4.2/5.1; add Python 3.14 and
Django 6.0 (Django 6.0 excluded on Python 3.11).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.1%. Comparing base (6b155fa) to head (fb05e36).

Files with missing lines Patch % Lines
tests/test_backend.py 25.0% 3 Missing ⚠️
django_redis/cache.py 0.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #818     +/-   ##
========================================
- Coverage    38.2%   38.1%   -0.0%     
========================================
  Files          48      48             
  Lines        3727    3731      +4     
  Branches      301     301             
========================================
+ Hits         1420    1421      +1     
- Misses       2006    2009      +3     
  Partials      301     301             
Flag Coverage Δ
mypy 38.1% <33.4%> (-<0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .github/workflows/ci.yml
django-version:
- '4.2'
- '5.1'
- '5.2'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/workflows/ci.yml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ruff.toml needs to be updated to support python3.10 onwards

Comment thread setup.cfg

[options]
python_requires = >=3.9
python_requires = >=3.11
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python 3.10 is still supported by Django 5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: TypeError in RedisCache.close() when called with signal parameter

2 participants