Skip to content

gh-155742: Use PyBytesWriter in decode_unicode_with_escapes() - #157587

Open
vstinner wants to merge 2 commits into
python:mainfrom
vstinner:decode_unicode
Open

vstinner wants to merge 2 commits into
python:mainfrom
vstinner:decode_unicode

Conversation

@vstinner

@vstinner vstinner commented Sep 15, 2026

Copy link
Copy Markdown
Member

PyWriterWriter_Finish() is not called, the writer is always discarded. It's just used as a temporary buffer.

Add non-ASCII tests to test_string_literals.

PyWriterWriter_Finish() is not called, the writer is always
discarded. It's just used as a temporary buffer.

Add non-ASCII tests to test_string_literals.
@vstinner

Copy link
Copy Markdown
Member Author

@lysnikolaou @pablogsal: I was surprised that test_string_literals has no test on non-ASCII string. Is it on purpose?

The test docstring says:

The tricky thing is what should happen when non-ASCII bytes are used inside literals.

@pablogsal

Copy link
Copy Markdown
Member

@lysnikolaou @pablogsal: I was surprised that test_string_literals has no test on non-ASCII string. Is it on purpose?

The test docstring says:

The tricky thing is what should happen when non-ASCII bytes are used inside literals.

Hummmm I don't think this is on purpose :(

@vstinner

Copy link
Copy Markdown
Member Author

Hummmm I don't think this is on purpose :(

Oh ok. Well, my PR adds some tests on Unicode characters :)

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.

2 participants