[ python-Bugs-1475080 ] example code in what's new/sqlite3 docs

SourceForge.net noreply at sourceforge.net
Wed Apr 26 06:15:22 CEST 2006


Bugs item #1475080, was opened at 2006-04-23 09:51
Message generated for change (Settings changed) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1475080&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: James Pryor (jpryor68)
>Assigned to: A.M. Kuchling (akuchling)
Summary: example code in what's new/sqlite3 docs

Initial Comment:
The documentation at
<http://docs.python.org/dev/whatsnew/node15.html#SECTION0001540000000000000000>

contains the following example code:

<code>
# Never do this -- insecure!
symbol = 'IBM'
c.execute("... where symbol = '%s'" % symbol)

# Do this instead
t = (symbol,)
c.execute('select * from stocks where symbol=?', ('IBM',))
</code>

The second block should instead read:

<code>
# Do this instead
t = ('IBM',)
c.execute('select * from stocks where symbol=?', t)
</code>


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1475080&group_id=5470


More information about the Python-bugs-list mailing list