-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-119609, PEP 756: Add PyUnicode_Export() function #123738
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
Closed
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c84f314
gh-119609: Add PyUnicode_Export() function
vstinner d0cdbd1
Address reviews
vstinner 9b33dca
Exclude from limited C API 3.13 and older
vstinner cf1f74a
Replace PyErr_Format() with PyErr_SetString()
vstinner 93d4470
Fix test_collections: implement UserString.__release_buffer__()
vstinner 17ad7b9
Add format parameter to PyUnicode_Export()
vstinner d683d0a
format must not be NULL
vstinner 78a70fa
Fix memory leak in unicode_releasebuffer()
vstinner 79207f5
Remove PyUnicode_GetBufferFormat() documentation
vstinner bc0fb69
Apply suggestions from code review
vstinner 2cdbc27
Set format to 0 on error
vstinner b5be22d
Remove trailing space
vstinner 2960b25
Change constant values
vstinner bcb41f3
Update constants value in the doc
vstinner 44cb702
Remove unicode_releasebuffer(); use bytes instead
vstinner 1809d8d
PyUnicode_Export() returns the format
vstinner 6707ef4
Fix PyUnicode_Export() signature in doc
vstinner abf5c58
Use _PyUnicode_EncodeUTF16() and _PyUnicode_EncodeUTF32()
vstinner 033fc07
Use signed int in C tests
vstinner 078dfcf
Update stable_abi: remove PyUnicode_GetBufferFormat()
vstinner 79c6d01
Revert "Use _PyUnicode_EncodeUTF16() and _PyUnicode_EncodeUTF32()"
vstinner 5479ab2
Allow surrogate characters in UTF-8
vstinner ab2f9b0
Merge branch 'main' into unicode_view
vstinner f71f230
Avoid a second copy in the UTF-8 export
vstinner 492f10a
UCS-4 export: remove one memory copy
vstinner b031163
Update Py_buffer format
vstinner 21e6012
Add PyUnicode_EXPORT_COPY flag
vstinner 3267ce6
doc
vstinner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/C_API/2024-09-05-16-57-51.gh-issue-119609.5EZ-kg.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,2 @@ | ||
Add :c:func:`PyUnicode_Export` and :c:func:`PyUnicode_Import` functions to | ||
export and import strings. Patch by Victor Stinner. |
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
Oops, something went wrong.
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.