#30115: inspectdb on SQLite crashes with TypeError: unhashable type: 'dict'
-------------------------------------+-------------------------------------
Reporter: Can Sarıgöl | Owner: Can
| Sarıgöl
Type: Bug | Status: assigned
Component: Database layer | Version: 2.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Nick Pope):
Sorry about this. I clearly forgot to take the special case of a tuple of
`(field_type, field_params_dict)` into account, `field_params_dict` being
the source of the error.
It turns out that this special case was a hack to handle `max_length` for
`CharField` on SQLite only which was introduced by
9ede371c85a97406eecb19974ab01163839636a0.
Since a9a773ff38a9fd28085e8b62b8a160c4e2ea5efb, size is returned by
`get_table_description()` on SQLite so `row.internal_size` is always
overriding the `max_length` returned in `field_params_dict`.
Here is a [https://github.com/django/django/pull/10871 PR] that fixes the
issue by removing this legacy approach to handling `max_length`.
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#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/068.4ecc3858b51bdb91aae923185e76a731%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.