Skip to content

Conversation

@miss-islington
Copy link
Contributor

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

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
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