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 ggenellina
Recipients georg.brandl, ggenellina
Date 2008-11-06.07:48:14
SpamBayes Score 8.952782e-08
Marked as misclassified No
Message-id <1225957697.4.0.46686050905.issue4267@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-11-06 07:48:17ggenellinasetrecipients: + ggenellina, georg.brandl
2008-11-06 07:48:17ggenellinasetmessageid: <1225957697.4.0.46686050905.issue4267@psf.upfronthosting.co.za>
2008-11-06 07:48:16ggenellinalinkissue4267 messages
2008-11-06 07:48:15ggenellinacreate