You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing unicode strings with non-ascii characters the ValueError is not built correctly. In CPython this manifests itself as an empty ValueError, whereas in PyPy3 it actually causes a segfault.
For example
from ciso8601 import parse_datetime
try:
parse_datetime("2019🐵01🐵01")
except ValueError as e:
assert e.args and "Invalid character" in e.args[0]
will fail with either a segfault or an assertion error depending on your interpreter.
In the real world this was seen with non-ascii dashes - e.g. for "2019—01—01"
The text was updated successfully, but these errors were encountered:
This seems to be caused by a non-ascii character ending up in the PyErr_Format function here: https://github.com/closeio/ciso8601/blob/master/module.c#L76 (also further up at line 58) - in particular replacing %c by %d whenever c is outside of the 0-256 range gives us a detailed error again (and stops segfaults in pypy3)
When parsing unicode strings with non-ascii characters the ValueError is not built correctly. In CPython this manifests itself as an empty ValueError, whereas in PyPy3 it actually causes a segfault.
For example
will fail with either a segfault or an assertion error depending on your interpreter.
In the real world this was seen with non-ascii dashes - e.g. for
"2019—01—01"
The text was updated successfully, but these errors were encountered: