[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

*error handling => exception emitted

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

... and also bpo-16379

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Ref. bpo-24139

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2021-02-12 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Exception originates from _pysqlite_seterror() in Modules/_sqlite/util.c, line 
64:
https://github.com/python/cpython/blob/master/Modules/_sqlite/util.c#L64

Error code 1 (SQLITE_ERROR, https://sqlite.org/rescode.html#error) is a generic 
sqlite3 error. Changing the default sqlite3 exception for this error code may 
not be what we want.

Anyway, we should clean up the error handling in the sqlite3 module. There are 
other inconsistencies apart from this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2020-12-19 Thread LIU Qingyuan


LIU Qingyuan  added the comment:

Python 3.9.1 (default, Dec 11 2020, 14:32:07) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> conn = sqlite3.connect("test.db")
>>> conn.execute("CREATE TABLE test (id INTEGER, str TEXT);")

>>> conn.execute("CREATE TABLE test (id INTEGER, str TEXT);")
Traceback (most recent call last):
  File "", line 1, in 
sqlite3.OperationalError: table test already exists
>>> 


I think the reproduction is way too easy and has nothing special so I didn't 
include one at the very beginning. That's a simple reproduction on interactive 
console.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2020-12-18 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2020-12-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The doc is the same in 3.10.

What OS and exact Python release? Can you post minimal code that verifies your 
claim?  (Someone what have to verify with 3.10 also.)

This would strike me as an error in the code.  We can fix 'wrong Exception' in 
the next release.  I am not sure whether we would do so in a current release.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2020-12-12 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +berker.peksag, ghaering

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42624] sqlite3 package document mistake

2020-12-12 Thread LIU Qingyuan


New submission from LIU Qingyuan :

In the document about sqlite3 package, it was suggested that when users are 
trying to create a table already exists, sqlite3.ProgrammingError is going to 
be thrown. However, the actual exception thrown is sqlite3.OperationalError, 
which is inconsistent with the document.

Doc: https://docs.python.org/3/library/sqlite3.html#exceptions

--
assignee: docs@python
components: Documentation
messages: 382904
nosy: docs@python, seeker-Liu
priority: normal
severity: normal
status: open
title: sqlite3 package document mistake
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com