#24836: force_text doesn't force SimpleLazyObject into a string
---------------------------------+------------------------------------
Reporter: riklaunim | Owner: nobody
Type: Bug | Status: new
Component: CSRF | Version: 1.8
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by knbk):
Specifically, `if type(s) is six.text_type` would cast a `SafeText`
instance to a plain string, so I'd say that `issubclass` is the way to go
in that case.
The problems with `json.dumps` and the like come from that fact that deep
down, on a C level, a `SimpleLazyObject` is simply not a string. I don't
believe that is something we can fix. Subclasses of `six.text_type` don't
have that problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/24836#comment:8>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.8fe89a5e52d6985b207d066f5bca11f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.