Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

register_type does not work with subclasses of str #1895

Open
realsuayip opened this issue Jan 22, 2024 · 0 comments
Open

register_type does not work with subclasses of str #1895

realsuayip opened this issue Jan 22, 2024 · 0 comments

Comments

@realsuayip
Copy link

realsuayip commented Jan 22, 2024

This is probably true for all primitive JSON types, I only tested str. Take this example:

from django.utils.safestring import SafeString, mark_safe
from kombu.utils.json import register_type

register_type(SafeString, "safestring", str, mark_safe)

This does not seem to work as SafeString is a subclass of str.

I'm not sure how this could be fixed. If nothing, we should probably document this.

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

No branches or pull requests

1 participant