Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-93370 : Deprecate sqlite3.version and sqlite3.version_info#93482
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
29 commits Select commit Hold shift + click to select a range
5debfa5 remove version and version_info from sqlite3
rawwar c648144 Merge branch 'python:main' into fix-issue-93370
rawwar ee0cec7 📜🤖 Added by blurb_it.
blurb-it[bot] 69e7410 used __getattr__ to raise warnings
rawwar 6c2a8c8 removed repeated declaration
rawwar 459a94c including feedback
rawwar 4a55ef3 move declaration to the start of the module
rawwar 1a75e5f fixed formatting issues
rawwar 8584a03 extra lines removed
rawwar fa80dd6 Update Lib/sqlite3/__init__.py
rawwar f47ddf3 Update Lib/sqlite3/dbapi2.py
rawwar f033aea Update Lib/sqlite3/dbapi2.py
rawwar 49ea9e1 updated docs
rawwar 451e9ef Update Lib/sqlite3/__init__.py
rawwar 591f2b9 Update Lib/sqlite3/dbapi2.py
rawwar 3f4e967 Apply suggestions from code review
rawwar d70b247 update blurb with correct ref
rawwar ed50588 included my name in ACKS
rawwar 8f06e31 Update Doc/library/sqlite3.rst
rawwar 836cddf adding tests for version and version_info deprec
rawwar 2102bf0 added dbapi2 tests and updated docs
rawwar 04dad03 use mod sqlite3 in sqlite3 doc
rawwar 81cf7fa Update Doc/library/sqlite3.rst
erlend-aasland 964cf86 Update Doc/library/sqlite3.rst
erlend-aasland f00b352 added assertIn and assertEqual in tests
rawwar 1920746 using assertEqual
rawwar 46922f6 removed white space
rawwar 45478cc Apply suggestions from code review
rawwar bc7b463 Update Lib/test/test_sqlite3/test_dbapi.py
erlend-aasland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -55,3 +55,16 @@ | ||
| """ | ||
| fromsqlite3.dbapi2import* | ||
| fromsqlite3.dbapi2import (_deprecated_names, | ||
| _deprecated_version_info, | ||
| _deprecated_version) | ||
| def__getattr__(name): | ||
| ifnamein_deprecated_names: | ||
| fromwarningsimportwarn | ||
| warn(f"{name} is deprecated and will be removed in Python 3.14", | ||
| DeprecationWarning, stacklevel=2) | ||
| returnglobals()[f"_deprecated_{name}"] | ||
| raiseAttributeError(f"module {__name__!r} has no attribute {name!r}") | ||
erlend-aasland marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -25,6 +25,9 @@ | ||
| import collections.abc | ||
| from _sqlite3 import * | ||
| from _sqlite3 import _deprecated_version | ||
| _deprecated_names = frozenset({"version", "version_info"}) | ||
| paramstyle = "qmark" | ||
| @@ -45,7 +48,7 @@ def TimeFromTicks(ticks): | ||
| def TimestampFromTicks(ticks): | ||
| return Timestamp(*time.localtime(ticks)[:6]) | ||
| version_info = tuple([int(x) for x in version.split(".")]) | ||
| _deprecated_version_info = tuple(map(int, _deprecated_version.split("."))) | ||
| sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")]) | ||
| Binary = memoryview | ||
| @@ -85,3 +88,12 @@ def convert_timestamp(val): | ||
| # Clean up namespace | ||
| del(register_adapters_and_converters) | ||
| def __getattr__(name): | ||
| if name in _deprecated_names: | ||
| from warnings import warn | ||
| warn(f"{name} is deprecated and will be removed in Python 3.14", | ||
rawwar marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading. Please reload this page. | ||
| DeprecationWarning, stacklevel=2) | ||
| return globals()[f"_deprecated_{name}"] | ||
| raise AttributeError(f"module{__name__!r} has no attribute{name!r}") | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1455,6 +1455,7 @@ Edward K. Ream | ||
| Chris Rebert | ||
| Marc Recht | ||
| John Redford | ||
| Kalyan Reddy | ||
| Terry J. Reedy | ||
| Gareth Rees | ||
| John Reese | ||
1 change: 1 addition & 0 deletions 1 Misc/NEWS.d/next/Library/2022-06-03-22-13-28.gh-issue-93370.tjfu9L.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Deprecate :data:`sqlite3.version` and :data:`sqlite3.version_info`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.