Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyhton 3.12 Bug report #603

Open
constantinedev opened this issue Nov 10, 2023 · 3 comments
Open

Pyhton 3.12 Bug report #603

constantinedev opened this issue Nov 10, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@constantinedev
Copy link

constantinedev commented Nov 10, 2023

I start with new python3 verison 3.12.0
Also have the error where connect DataBase

Traceback (most recent call last):
  File "/home/t/Development/python/FKPJ/ClinicSYS/run.py", line 1, in <module>
    import re, os, io, json, sqlite_utils, requests, pytz, logging
  File "/home/t/.local/lib/python3.12/site-packages/sqlite_utils/__init__.py", line 1, in <module>
    from .db import Database
  File "/home/t/.local/lib/python3.12/site-packages/sqlite_utils/db.py", line 277, in <module>
    class Database:
  File "/home/t/.local/lib/python3.12/site-packages/sqlite_utils/db.py", line 306, in Database
    filename_or_conn: Optional[Union[str, pathlib.Path, sqlite3.Connection]] = None,
                                                        ^^^^^^^^^^^^^^^^^^

This bug come from sqlite-utils since's v3.33.
Anyone get the same ?

As well now of the resolved plan just keep the sqlite-utils version in python3.12 with v3.32.1 [tested]
but where are the sqlite3.Connection problem....

This won't happen on python version down to 3.11[tested]
Just the python3.12.0, I have test this error are come from the sqlite3 connection
The error say from sqlite_utils and with the sqlite3 Connection, what can I do.

Let fix together.

@simonw simonw added the bug Something isn't working label Dec 8, 2023
@simonw
Copy link
Owner

simonw commented Dec 8, 2023

I'm unable to replicate this issue. This is with a fresh install of sqlite-utils==3.35.2:

(base) ~ python3.12
Python 3.12.0 (v3.12.0:0fb18b02c8, Oct  2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite_utils
>>> db = sqlite_utils.Database(memory=True)
>>> db["foo"].insert({"bar": 1})
<Table foo (bar)>
>>> import sys
>>> sys.version
'3.12.0 (v3.12.0:0fb18b02c8, Oct  2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)]'

@tobych
Copy link

tobych commented Apr 29, 2024

I, too, am unable to replicate this issue. I've tried doing what Simon did above, and opening a local file on my machine. I used a fresh install of sqlite-utils==3.33 and Python 3.12.0 (on macOS Sonoma 14.1.1, Intel).

I suggest closing this as unable to replicate. Not sure how that works on GitHub though.

@JukkaSartinen
Copy link

JukkaSartinen commented Aug 14, 2024

I'm also unable to replicate this issue. I'm using sqlite-utils 3.37 and Python 3.12.5 on Windows 10

I copied Simon's commands from his reply and also tested with saving database to disk. Everything works as expected. Results below.

Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug  6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import sqlite_utils
db = sqlite_utils.Database(memory=True)
db["foo"].insert({"bar": 1})
<Table foo (bar)>
db["foo"].get(1)
{'bar': 1}
db2 = sqlite_utils.Database("bar.db")
db2["bar"].insert({"bar": 1})
<Table bar (bar)>
db2["bar"].insert({"bar": 2})
<Table bar (bar)>
db2["bar"].get(2)
{'bar': 2}
import sys
sys.version
3.12.5 (tags/v3.12.5:ff3bc82, Aug  6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)]

Should this issue be closed if no one is able to replicate the bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants