summaryrefslogtreecommitdiffstats
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorPaul Ganssle <pganssle@users.noreply.github.com>2018-08-23 15:06:20 (GMT)
committerTal Einat <taleinat+github@gmail.com>2018-08-23 15:06:20 (GMT)
commit096329f0b2bf5e3f0a16363aa631d993ce078737 (patch)
tree503291191bdb7ecd0d42d02bd8a35b72af468d81 /Lib/tempfile.py
parentc33bb5d4016fb2fc8f3b6d4b0c14b73b33cdb3cf (diff)
downloadcpython-096329f0b2bf5e3f0a16363aa631d993ce078737.zip
cpython-096329f0b2bf5e3f0a16363aa631d993ce078737.tar.gz
cpython-096329f0b2bf5e3f0a16363aa631d993ce078737.tar.bz2
bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate code points (GH-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>
Diffstat (limited to 'Lib/tempfile.py')
0 files changed, 0 insertions, 0 deletions