[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-10-23 Thread STINNER Victor
STINNER Victor added the comment: Thanks Paul Ganssle for your fixes! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-10-23 Thread Tal Einat
Change by Tal Einat : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-10-22 Thread miss-islington
miss-islington added the comment: New changeset 18450be94d74b5c7e05a08f4aaa4792749ecda18 by Miss Islington (bot) in branch '3.7': bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959) https://github.com/python/cpython/commit/18450be94d74b5c7e05a08f4aaa4792749ecda18

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-10-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +9380 stage: resolved -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-10-22 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3df85404d4bf420db3362eeae1345f2cad948a71 by Victor Stinner (Paul Ganssle) in branch 'master': bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959)

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-10-22 Thread STINNER Victor
STINNER Victor added the comment: I reopen the issue since there are still 2 open PRs: PR 8878 and PR 8959. -- nosy: +vstinner resolution: fixed -> status: closed -> open ___ Python tracker

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-27 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +8434 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- pull_requests: +8354 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread Tal Einat
Tal Einat added the comment: Thanks for the report and initial patch, Alexey! Thanks for the followup and final PR, Paul! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread miss-islington
miss-islington added the comment: New changeset 89b1654e0bc7bc69709dca86dd4c92eb7122ac7e by Miss Islington (bot) in branch '3.7': bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread Tal Einat
Tal Einat added the comment: New changeset 096329f0b2bf5e3f0a16363aa631d993ce078737 by Tal Einat (Paul Ganssle) in branch 'master': bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-8862)

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +8352 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-22 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +8336 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree, that raising UnicodeEncodeError instead of ValueError is acceptable, since the former is a subclass of the latter. But since the default implementation raises more specialized subclass, it is probably that the user code will catch more narrow

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-22 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +8331 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-21 Thread Paul Ganssle
Paul Ganssle added the comment: > Note that technically a difference between C and Python implementation of > fromisoformat() will still remain: if a part of the input string before or > after the separator contains surrogates, the C code will throw a > UnicodeEncodeError while the Python

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-21 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I will be glad to rebase my PR and remove the try/except from the test if you remove the dependency of separator searching code on PyUnicode_AsUTF8AndSize() as you suggest. Or we can go the other way and merge mine first -- whatever you prefer. Note that

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-21 Thread Paul Ganssle
Paul Ganssle added the comment: So this is related to something I was actually meaning to fix. When I wrote this code I didn't understand the way PyUnicode works, there's actually no need to call `PyUnicode_AsUTF8AndSize()` on the entire unicode string. My understanding is that each glyph

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-21 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +8322 stage: -> patch review ___ Python tracker ___ ___

[issue34454] datetime: NULL dereference in fromisoformat() on PyUnicode_AsUTF8AndSize() failure

2018-08-21 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : A failure of PyUnicode_AsUTF8AndSize() in various fromisoformat() functions in Modules/_datetimemodule.c leads to NULL dereference due to the missing check, e.g.: >>> from datetime import date >>> date.fromisoformat('\ud800') Segmentation fault (core