Commit 8ea4978
committed
Add an explicit ASCII check.
It may seem like this isn't necessary, because:
datetime.date.fromisoformat('1963-06-1৪')
fails (properly! it's non-ASCII) on CPython, but that's only because the
datetime module swaps itself out for the C implementation, and the C
implementation blows up on the non-ASCII string.
The pure-python implementation (which in some situations may get used)
does no check itself for ASCII-ness.
There's a comment saying as much here:
https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/datetime.py#L266-L267
So, let's check explicitly ourselves regardless of this working
occasionally.
Thanks PyPy for pointing out the bug.1 parent f138b23 commit 8ea4978
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
| 367 | + | |
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| |||
0 commit comments