This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients georg.brandl, vstinner
Date 2010-03-13.03:13:38
SpamBayes Score 4.832007e-11
Marked as misclassified No
Message-id <1268450021.57.0.736036682608.issue8129@psf.upfronthosting.co.za>
In-reply-to
Content
Python documentation has the prototype:

sqlite3.connect(database[, timeout, isolation_level, detect_types, factory])

http://docs.python.org/library/sqlite3.html#sqlite3.connect

Source code:

 - sqlite.rst: .. function:: connect(database[, timeout, isolation_level, detect_types, factory])
 - connect() documentation: connect(database[, 
timeout, isolation_level, detect_types, factory])
 - module_connect(): char *kwlist[] = {"database", "timeout", "detect_types", "isolation_level", "check_same_thread", "factory", "cached_statements", NULL, NULL};
 - pysqlite_connection_init(): char *kwlist[] = {"database", "timeout", "detect_types", "isolation_level", "check_same_thread", "factory", "cached_statements", NULL, NULL};

module_connect() and pysqlite_connection_init() use the same keyword list, but the documentation invert arguments detect_types and isolation_level, and miss check_same_thread and cached_statements arguments.

--

Example:

>>> import sqlite3
>>> con=sqlite3.connect(':memory:', 2.0, 'DEFER')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: an integer is required
>>> con=sqlite3.connect(':memory:', 2.0, True)
>>> con=sqlite3.connect(':memory:', 2.0, isolation_level='DEFER')

The third argument is a boolean, it's the detect_types option (not the isolation level, a string).
History
Date User Action Args
2010-03-13 03:13:41vstinnersetrecipients: + vstinner, georg.brandl
2010-03-13 03:13:41vstinnersetmessageid: <1268450021.57.0.736036682608.issue8129@psf.upfronthosting.co.za>
2010-03-13 03:13:39vstinnerlinkissue8129 messages
2010-03-13 03:13:39vstinnercreate