[Django] #26613: SQLite3 DB backend should remove dependency on sqlite3 module

20 views
Skip to first unread message

Django

unread,
May 13, 2016, 11:09:27 AM5/13/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
----------------------------------------------+--------------------
Reporter: Gatzy118 | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------------------+--------------------
Given Django tries to use pysqlite2 by default anyway, would it be
reasonably to change in django.db.backends.sqlite3.schema this:

{{{
35 def quote_value(self, value):
36 # The backend "mostly works" without this function and there
are use
37 # cases for compiling Python without the sqlite3 libraries
(e.g.
38 # security hardening).
39 import sqlite3
40 try:
41 value = sqlite3.adapt(value)
42 except sqlite3.ProgrammingError:
43 pass
44 # Manual emulation of SQLite parameter quoting
45 if isinstance(value, type(True)):
...
}}}

Into this:

{{{
41 try:
42 import sqlite3
43 value = sqlite3.adapt(value)
44 except ImportError:
45 pass
46 except sqlite3.ProgrammingError:
47 pass
48 # Manual emulation of SQLite parameter quoting
49 if isinstance(value, type(True)):
...
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26613>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 16, 2016, 7:05:57 PM5/16/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
-------------------------------------+-------------------------------------
Reporter: Gatzy118 | Owner: pnl8zp
Type: Bug | Status: assigned
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by pnl8zp):

* status: new => assigned
* needs_better_patch: => 0
* owner: nobody => pnl8zp
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/26613#comment:1>

Django

unread,
May 16, 2016, 7:48:19 PM5/16/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
-------------------------------------+-------------------------------------
Reporter: Gatzy118 | Owner: pnl8zp
Type: Bug | Status: closed

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by pnl8zp):

* status: assigned => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/26613#comment:2>

Django

unread,
May 16, 2016, 7:50:28 PM5/16/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
-------------------------------------+-------------------------------------
Reporter: Gatzy118 | Owner: pnl8zp
Type: Bug | Status: new

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by MarkusH):

* status: closed => new
* resolution: fixed =>


Comment:

Please don't mark a ticket as fixed until the respective patch has been
committed. Thank you.

--
Ticket URL: <https://code.djangoproject.com/ticket/26613#comment:3>

Django

unread,
May 16, 2016, 8:22:46 PM5/16/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
-------------------------------------+-------------------------------------
Reporter: Gatzy118 | Owner: pnl8zp
Type: Bug | Status: new

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by pnl8zp):

Sorry. Here's a link to the branch:

[https://github.com/pnl8zp/django/tree/ticket_26613]

--
Ticket URL: <https://code.djangoproject.com/ticket/26613#comment:4>

Django

unread,
May 17, 2016, 9:49:54 PM5/17/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
-------------------------------------+-------------------------------------
Reporter: Gatzy118 | Owner: pnl8zp
Type: Bug | Status: new

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26613#comment:5>

Django

unread,
May 17, 2016, 10:14:25 PM5/17/16
to django-...@googlegroups.com
#26613: SQLite3 DB backend should remove dependency on sqlite3 module
-------------------------------------+-------------------------------------
Reporter: Gatzy118 | Owner: pnl8zp
Type: Bug | Status: closed

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"3630b49b556785af63077407418296ada31b0b3e" 3630b49]:
{{{
#!CommitTicketReference repository=""
revision="3630b49b556785af63077407418296ada31b0b3e"
Fixed #26613 -- Made sqlite3 optional in SchemaEditor.quote_value().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26613#comment:6>

Reply all
Reply to author
Forward
0 new messages