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: fix test_sqlite for AIX
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: test_database_source_name fails with SQLite 3.7.9
View: 34743
Assigned To: Nosy List: Michael.Felt, berker.peksag
Priority: normal Keywords: patch

Created on 2018-10-01 08:36 by Michael.Felt, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9653 closed Michael.Felt, 2018-10-01 08:48
Messages (5)
msg326769 - (view) Author: Michael Felt (Michael.Felt) * Date: 2018-10-01 08:36
On AIX test_sqlite fails with:

======================================================================
FAIL: test_database_source_name (sqlite3.test.backup.BackupTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aixtools/python/git/aix-pr/Lib/sqlite3/test/backup.py", line 146, in test_database_source_name
    ['SQL logic error', 'SQL logic error or missing database']
AssertionError: 'unrecognized error code: 1' not found in ['SQL logic error', 'SQL logic error or missing database']

Likely this is because the sqlite3 that is installed either has a bug, is too old, or was overly optimized and the expected error message is not being returned.

A simple addition as:
    def test_database_source_name(self):
        with sqlite.connect(':memory:') as bck:
            self.cx.backup(bck, name='main')
        with sqlite.connect(':memory:') as bck:
            self.cx.backup(bck, name='temp')
        with self.assertRaises(sqlite.OperationalError) as cm:
            with sqlite.connect(':memory:') as bck:
                self.cx.backup(bck, name='non-existing')
        self.assertIn(
            str(cm.exception),
            ['SQL logic error', 'SQL logic error or missing database', 'unrecognized error code: 1']
        )

allows to test to pass.

Again, this is not a problem with either python or AIX - only yhe implementation of sqlite3 installed.

My hope is that the PR with the modification above (add 'unrecognized error code: 1') will be accepted.

Thx for your consideration.
msg326770 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-10-01 08:49
Could you try latest master? I think this is a duplicate of issue 34743 and it has already been fixed in https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d.
msg326794 - (view) Author: Michael Felt (Michael.Felt) * Date: 2018-10-01 11:37
I just pulled master, did not see Modules/_sqlite/connection.c
<https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d#diff-affe43c743133796bb0a7eec464483b9>
in the list, but I redo everything for just in case and update later.

On 10/1/2018 10:49 AM, Berker Peksag wrote:
> Berker Peksag <berker.peksag@gmail.com> added the comment:
>
> Could you try latest master? I think this is a duplicate of issue 34743 and it has already been fixed in https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d.
>
> ----------
> nosy: +berker.peksag
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue34860>
> _______________________________________
>
msg326816 - (view) Author: Michael Felt (Michael.Felt) * Date: 2018-10-01 16:51
Yes, that seems to have fixed it already. Closing the PR and issue!

Thx for the quick response!

On 10/1/2018 1:37 PM, Michael Felt wrote:
> Michael Felt <aixtools@felt.demon.nl> added the comment:
>
> I just pulled master, did not see Modules/_sqlite/connection.c
> <https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d#diff-affe43c743133796bb0a7eec464483b9>
> in the list, but I redo everything for just in case and update later.
>
> On 10/1/2018 10:49 AM, Berker Peksag wrote:
>> Berker Peksag <berker.peksag@gmail.com> added the comment:
>>
>> Could you try latest master? I think this is a duplicate of issue 34743 and it has already been fixed in https://github.com/python/cpython/commit/b10a64d117de6121ea3e79c467c4107f8f399f3d.
>>
>> ----------
>> nosy: +berker.peksag
>>
>> _______________________________________
>> Python tracker <report@bugs.python.org>
>> <https://bugs.python.org/issue34860>
>> _______________________________________
>>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue34860>
> _______________________________________
>
msg326817 - (view) Author: Michael Felt (Michael.Felt) * Date: 2018-10-01 16:52
duplicate of issue34743
History
Date User Action Args
2022-04-11 14:59:06adminsetgithub: 79041
2018-10-01 17:02:41berker.peksagsetsuperseder: test_database_source_name fails with SQLite 3.7.9
2018-10-01 16:52:50Michael.Feltsetstatus: open -> closed
resolution: duplicate
messages: + msg326817

stage: patch review -> resolved
2018-10-01 16:51:35Michael.Feltsetmessages: + msg326816
2018-10-01 11:37:32Michael.Feltsetmessages: + msg326794
2018-10-01 08:49:12berker.peksagsetnosy: + berker.peksag
messages: + msg326770
2018-10-01 08:48:04Michael.Feltsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9044
2018-10-01 08:36:44Michael.Feltcreate