Skip to content

[3.15] gh-157710: Add MemoryError tests to PyUnicodeWriter - #159548

Merged
vstinner merged 3 commits into
python:3.15from
vstinner:unicode15
Oct 16, 2026
Merged

vstinner merged 3 commits into
python:3.15from
vstinner:unicode15

Conversation

@vstinner

@vstinner vstinner commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

)

Make sure that a writer can be modified before writing into it.

* Document that PyUnicodeWriter is not thread safe.
* Add singletons tests to test_capi.test_unicode.
* Check PyUnicode_CheckExact() earlier in _PyUnicode_IsModifiable().

(cherry picked from commit 8542958)
)

Add a test changing the buffer kind multiple times.

Add assertions to _PyUnicodeWriter_InitWithBuffer().

(cherry picked from commit 6b97452)
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 16, 2026
@vstinner vstinner added needs backport to 3.14 bugs and security fixes and removed type-feature A feature request or enhancement labels Oct 16, 2026
@vstinner
vstinner enabled auto-merge (squash) October 16, 2026 15:48
@read-the-docs-community

Copy link
Copy Markdown

@vstinner
vstinner merged commit adc1127 into python:3.15 Oct 16, 2026
62 of 64 checks passed
@vstinner
vstinner deleted the unicode15 branch October 16, 2026 16:18
@miss-islington-app

Copy link
Copy Markdown

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @vstinner, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker adc11271c117802ad1751c0cfbac131d68d0c156 3.14

vstinner added a commit that referenced this pull request Oct 16, 2026
[3.15] gh-157710: Add MemoryError tests to PyUnicodeWriter (#159548)

* gh-157710: Add _PyUnicodeWriter_CanWrite() function (#157712)

Make sure that a writer can be modified before writing into it.

* Document that PyUnicodeWriter is not thread safe.
* Add singletons tests to test_capi.test_unicode.
* Check PyUnicode_CheckExact() earlier in _PyUnicode_IsModifiable().

(cherry picked from commit 8542958)

* gh-157710: Add MemoryError tests to PyUnicodeWriter (#157853)

Add a test changing the buffer kind multiple times.

Add assertions to _PyUnicodeWriter_InitWithBuffer().

(cherry picked from commit 6b97452)

* No need to export _PyUnicode_IsModifiable()

(cherry picked from commit adc1127)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant