[New-bugs-announce] [issue5005] 3.0 sqlite doc: most refers to pysqlite2, use 2.x syntax.

Terry J. Reedy report at bugs.python.org
Tue Jan 20 00:15:10 CET 2009


New submission from Terry J. Reedy <tjreedy at udel.edu>:

1. Several examples start with
>>> from pysqlite2 import dbapi2 as sqlite3

Traceback (most recent call last):
  File "<pyshell#23>", line 1, in <module>
    from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named pysqlite2

I presume that should be just 'import sqlite3'.

2. Print statements need conversion and future import deleted (2to3?).

3. Cut and paste crashes due to 'bad' blank line.  For instance,
# A minimal SQLite shell for experiments
...
>>> while True:
...     line = raw_input()
...     if line == "":
...         break
...     buffer += line
...     if sqlite3.complete_statement(buffer):
...         try:
...             buffer = buffer.strip()
...             cur.execute(buffer)
...
  File "<stdin>", line 10

    ^
IndentationError: unexpected unindent
>>>             if buffer.lstrip().upper().startswith("SELECT"):
  File "<stdin>", line 1
    if buffer.lstrip().upper().startswith("SELECT"):
    ^
IndentationError: unexpected indent

----------
messages: 80218
nosy: tjreedy
severity: normal
status: open
title: 3.0 sqlite doc: most refers to pysqlite2, use 2.x syntax.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5005>
_______________________________________


More information about the New-bugs-announce mailing list