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

Sqlite3.OptimizedUnicode deprecation warning #216

Closed
heidi-holappa opened this issue Jun 9, 2023 · 1 comment · Fixed by #221
Closed

Sqlite3.OptimizedUnicode deprecation warning #216

heidi-holappa opened this issue Jun 9, 2023 · 1 comment · Fixed by #221

Comments

@heidi-holappa
Copy link

heidi-holappa commented Jun 9, 2023

Hi!

Line 105 from interface.py is giving a deprecation warning while running unittests. It seems that Sqlite3.OptimizedUnicode was deprecated in Python 3.10 and was removed in 3.12.

From what's new 3.12:

The following undocumented [sqlite3](https://docs.python.org/3.12/library/sqlite3.html#module-sqlite3) features, deprecated in Python 3.10, are now removed:
- sqlite3.enable_shared_cache()
- sqlite3.OptimizedUnicode

If a shared cache must be used, open the database in URI mode using the cache=shared query parameter.

The sqlite3.OptimizedUnicode text factory has been an alias for [str](https://docs.python.org/3.12/library/stdtypes.html#str) since Python 3.3. Code that previously set the text factory to OptimizedUnicode can either use str explicitly, or rely on the default value which is also str.

The purpose of this issue is to let the authors know of this warning. I'm not familiar enough with sqlite3 string handling to have a suggestion to make for a new default text_factory.

@daler
Copy link
Owner

daler commented Jul 4, 2023

Thanks for reporting, fixed in 20a9102

@daler daler closed this as completed Jul 4, 2023
@daler daler mentioned this issue Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants