Skip to content

Conversation

smaccona
Copy link

@smaccona smaccona commented Aug 6, 2025

  • Remove **kwargs from self.client.close() call in RedisCache.close()
  • The DefaultClient.close() method doesn't accept parameters since commit c7be6cc
  • This fixes TypeError when Django's request_finished signal calls cache.close(signal=...)
  • Add test case to verify close() works with arbitrary keyword arguments

Fixes issue where django-redis 6.0+ would crash with: TypeError: close() got an unexpected keyword argument 'signal'

Closes #787.

smaccona and others added 2 commits August 6, 2025 13:11
- Remove **kwargs from self.client.close() call in RedisCache.close()
- The DefaultClient.close() method doesn't accept parameters since commit c7be6cc
- This fixes TypeError when Django's request_finished signal calls cache.close(signal=...)
- Add test case to verify close() works with arbitrary keyword arguments

Fixes issue where django-redis 6.0+ would crash with:
TypeError: close() got an unexpected keyword argument 'signal'
@WisdomPill
Copy link
Member

@smaccona Django 6 is not out yet, can you add it first and then fix the error?

@smaccona
Copy link
Author

@WisdomPill I am not clear on what you are asking - I have not tested this in Django 6, only in Django 4.2 (originally) and now Django 5.2 as well. Here are the versions from my original bug report:

  • Python version: 3.9+
  • Django Redis Version: 6.0.0+
  • Django Version: 4.2 (but I think this will apply to multiple versions)
  • Redis Version: 7.0
  • redis-py Version: 6.2.0
  • gunicorn Version: 22.0.0 (but I think this will happen in other versions and other WSGI servers also)

The django-redis version tested was django-redis 6.0.0 (2025-06-17).

@rado-r
Copy link

rado-r commented Oct 8, 2025

Yes, I have same issue with 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

3 participants