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.

classification
Title: sqlite3 documentation
Type: Stage:
Components: Documentation Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, ggenellina
Priority: normal Keywords: patch

Created on 2008-11-06 07:48 by ggenellina, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sqlite3.diff ggenellina, 2008-11-06 07:48 patch to sqlite3.rst
Messages (2)
msg75548 - (view) Author: Gabriel Genellina (ggenellina) Date: 2008-11-06 07:48
Three small changes to sqlite3 documentation:

1) (mostly cosmetic) In the second example, changed what was "a tuple 
of tuples" to "a list of tuples" to follow common practice.

2) "DEFERRED", "IMMEDIATE" and "EXLUSIVE" (possible values for 
Connection.isolation_level) are strings, not module constants, so 
should be surrounded with quotes.

2) The iterdump example is not well written. Currently says:

       con = sqlite3.connect('existing_db.db')
       full_dump = os.linesep.join(con.iterdump())
       f = open('dump.sql', 'w')
       f.writelines(full_dump)
       f.close()

Using os.linesep to join lines to be written to a text file has strange 
results in non-Unix systems; joining the *whole* database dump into a 
big string isn't a good idea; and finally, writelines(some_string) will 
write the text one char at a time (!). 
I've rewritten it as:

       with open('dump.sql', 'w') as f:
           for line in con.iterdump():
               f.write('%s\n' % line)

to take advantage of iterdump's lazy nature.
msg75556 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-11-06 10:19
Thanks, applied in r67118.
History
Date User Action Args
2022-04-11 14:56:40adminsetgithub: 48517
2008-11-06 10:19:17georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg75556
2008-11-06 07:48:16ggenellinacreate