Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.7] bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)#8877

Merged
miss-islington merged 1 commit into
python:3.7python/cpython:3.7from
miss-islington:backport-096329f-3.7miss-islington/cpython:backport-096329f-3.7Copy head branch name to clipboard
Aug 23, 2018
Merged

[3.7] bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)#8877
miss-islington merged 1 commit into
python:3.7python/cpython:3.7from
miss-islington:backport-096329f-3.7miss-islington/cpython:backport-096329f-3.7Copy head branch name to clipboard

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 23, 2018

Copy link
Copy Markdown
Contributor

The current C implementations crash if the input includes a surrogate
Unicode code point, which is not possible to encode in UTF-8.

Important notes:

  1. It is possible to pass a non-UTF-8 string as a separator to the
    .isoformat() methods.
  2. The pure-Python datetime.fromisoformat() implementation accepts
    strings with a surrogate as the separator.

In datetime.fromisoformat(), in the special case of non-UTF-8 separators,
this implementation will take a performance hit by making a copy of the
input string and replacing the separator with 'T'.

Co-authored-by: Alexey Izbyshev izbyshev@ispras.ru
Co-authored-by: Paul Ganssle paul@ganssle.io
(cherry picked from commit 096329f)

Co-authored-by: Paul Ganssle pganssle@users.noreply.github.com

https://bugs.python.org/issue34454

…gate code points (pythonGH-8862)

The current C implementations **crash** if the input includes a surrogate
Unicode code point, which is not possible to encode in UTF-8.

Important notes:

1.  It is possible to pass a non-UTF-8 string as a separator to the
    `.isoformat()` methods.
2.  The pure-Python `datetime.fromisoformat()` implementation accepts
    strings with a surrogate as the separator.

In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators,
this implementation will take a performance hit by making a copy of the
input string and replacing the separator with 'T'.

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Co-authored-by: Paul Ganssle <paul@ganssle.io>
(cherry picked from commit 096329f)

Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@pganssle and @taleinat: Backport status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 89b1654 into python:3.7 Aug 23, 2018
@miss-islington miss-islington deleted the backport-096329f-3.7 branch August 23, 2018 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.