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

gh-126259: Fix warning in doctest of sqlite3 #126260

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 31, 2024

@graingert
Copy link
Contributor

Is it possible to use a with contextlib.closing(... here?

graingert

This comment was marked as resolved.

@sobolevn
Copy link
Member Author

But why? I would need to import this lib and use a different syntax from other examples.

@graingert
Copy link
Contributor

Ah I see there's a lot of other manual closing in the other doctests. This is not the recommended way to use this module, but it is consistent with the other tests. Perhaps this should be fixed in another ticket

@erlend-aasland
Copy link
Contributor

This is not the recommended way to use this module [...]

This comment does not make sense to me, given what we're discussing. The doctests are all example code either in the reference or in the tutorial; showing the user how to set up and close a connection for each example would be contra-productive. Also, adding unneeded .. testsetup/.. testcleanup boilerplate for setting up and tearing down a connection in sqlite3.rst would not add any value at all.

@erlend-aasland erlend-aasland added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Nov 1, 2024
@erlend-aasland erlend-aasland merged commit 295262c into python:main Nov 1, 2024
40 checks passed
@miss-islington-app

This comment was marked as outdated.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 1, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 1, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 1, 2024

GH-126265 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 1, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 1, 2024

GH-126266 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Nov 1, 2024
erlend-aasland pushed a commit that referenced this pull request Nov 1, 2024
erlend-aasland pushed a commit that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants