{{{
class DjangoSession(models.Model):
Traceback (most recent call last):
File "./manage.py", line 21, in <module>
main()
File "./manage.py", line 17, in main
execute_from_command_line(sys.argv)
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/__init__.py", line 381, in
execute_from_command_line
utility.execute()
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/commands/inspectdb.py", line 34, in
handle
for line in self.handle_inspection(options):
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/commands/inspectdb.py", line 131, in
handle_inspection
field_type, field_params, field_notes =
self.get_field_type(connection, table_name, row)
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/core/management/commands/inspectdb.py", line 239, in
get_field_type
field_type = connection.introspection.get_field_type(row.type_code,
row)
File
"/Users/can/Documents/Contribute_projects/Tests/django2_2_alfa2/venv/lib/python3.7
/site-packages/django/db/backends/sqlite3/introspection.py", line 65, in
get_field_type
if description.pk and field_type in {'BigIntegerField',
'IntegerField'}:
TypeError: unhashable type: 'dict'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30115>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:1>
* type: Uncategorized => Bug
* component: Uncategorized => Database layer (models, ORM)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
OK, yes, thanks for the report.
This works against 2.1.5 but errors as reported against 2.2a1:
{{{
django-admin startproject ticket_30115
cd ticket_30115/
./manage.py migrate
./manage.py inspectdb
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:2>
* type: Bug => Uncategorized
* component: Database layer (models, ORM) => Uncategorized
* severity: Release blocker => Normal
* stage: Accepted => Unreviewed
Comment:
[https://code.djangoproject.com/ticket/30115 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:3>
* type: Uncategorized => Bug
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:4>
* needs_tests: 0 => 1
* easy: 1 => 0
Comment:
Is that code untested or this caused by a version of SQLite that's
untested on Jenkins?
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:5>
* owner: nobody => Can Sarıgöl
* status: new => assigned
Comment:
I am adding test for it
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:6>
Comment (by Carlton Gibson):
{{{
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.24.0'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:7>
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>
* owner: Can Sarıgöl => Nick Pope
* needs_tests: 1 => 0
Comment:
I think no tests should be needed as we're removing the code that caused
the broken behaviour.
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:9>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"bff748df3e1e1c0077e02df2b77bda2b827ad129" bff748df]:
{{{
#!CommitTicketReference repository=""
revision="bff748df3e1e1c0077e02df2b77bda2b827ad129"
Fixed #30115 -- Fixed SQLite introspection crash with a varchar primary
key.
Removed obsolete max_length handling for CharField that caused the issue.
Regression in a35d2a4510d5beec398b1007aaa26492d6aedf97.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:11>
Comment (by Tim Graham <timograham@…>):
In [changeset:"e53e64280df417c1f1acd63171746b28cd42edef" e53e642]:
{{{
#!CommitTicketReference repository=""
revision="e53e64280df417c1f1acd63171746b28cd42edef"
[2.2.x] Fixed #30115 -- Fixed SQLite introspection crash with a varchar
primary key.
Removed obsolete max_length handling for CharField that caused the issue.
Regression in a35d2a4510d5beec398b1007aaa26492d6aedf97.
Backport of bff748df3e1e1c0077e02df2b77bda2b827ad129 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30115#comment:12>