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-111089: Use PyUnicode_AsUTF8() in sqlite3 #111122

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 20, 2023

PyUnicode_AsUTF8() now raises an exception if the string contains embedded null characters.

PyUnicode_AsUTF8() now raises an exception if the string contains
embedded null characters.
@vstinner
Copy link
Member Author

@serhiy-storchaka: I found many functions using PyUnicode_AsUTF8AndSize() and then compare size to strlen(str) to check for embeded null characters. But these functions use a more precise error message than the generic "embedded null character". So I left these functions unchanged.

cc @erlend-aasland

@vstinner vstinner merged commit 37e4e20 into python:main Oct 20, 2023
29 checks passed
@vstinner vstinner deleted the sqlite_asutf8 branch October 20, 2023 18:04
@vstinner
Copy link
Member Author

Merged. Thanks for reviews Erlend and Serhiy.

vstinner added a commit to vstinner/cpython that referenced this pull request Nov 7, 2023
vstinner added a commit that referenced this pull request Nov 7, 2023
* Revert "gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)"

This reverts commit d9b606b.

* Revert "gh-111089: Use PyUnicode_AsUTF8() in getargs.c (#111620)"

This reverts commit cde1071.

* Revert "gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)"

This reverts commit d731579.

* Revert "gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)"

This reverts commit d8f32be.

* Revert "gh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)"

This reverts commit 37e4e20.
hugovk pushed a commit to hugovk/cpython that referenced this pull request Nov 8, 2023
* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (python#111585)"

This reverts commit d9b606b.

* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in getargs.c (python#111620)"

This reverts commit cde1071.

* Revert "pythongh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (python#111091)"

This reverts commit d731579.

* Revert "pythongh-111089: Add PyUnicode_AsUTF8() to the limited C API (python#111121)"

This reverts commit d8f32be.

* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in sqlite3 (python#111122)"

This reverts commit 37e4e20.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
PyUnicode_AsUTF8() now raises an exception if the string contains
embedded null characters.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (python#111585)"

This reverts commit d9b606b.

* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in getargs.c (python#111620)"

This reverts commit cde1071.

* Revert "pythongh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (python#111091)"

This reverts commit d731579.

* Revert "pythongh-111089: Add PyUnicode_AsUTF8() to the limited C API (python#111121)"

This reverts commit d8f32be.

* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in sqlite3 (python#111122)"

This reverts commit 37e4e20.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
PyUnicode_AsUTF8() now raises an exception if the string contains
embedded null characters.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (python#111585)"

This reverts commit d9b606b.

* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in getargs.c (python#111620)"

This reverts commit cde1071.

* Revert "pythongh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (python#111091)"

This reverts commit d731579.

* Revert "pythongh-111089: Add PyUnicode_AsUTF8() to the limited C API (python#111121)"

This reverts commit d8f32be.

* Revert "pythongh-111089: Use PyUnicode_AsUTF8() in sqlite3 (python#111122)"

This reverts commit 37e4e20.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants