(core) Fix import parsing from choking up on Python isdigit() surprises

Summary:
Python isdigit() returns true for unicode characters such as "²", which fail
when used as an argument to int().

Instead, be explicit about only considering characters 0-9 to be digits.

Test Plan: Added a test case which produces an error without this change.

Reviewers: alexmojaki

Reviewed By: alexmojaki

Differential Revision: https://phab.getgrist.com/D3027
This commit is contained in:
Dmitry S
2021-09-20 14:38:02 -04:00
parent cd241a633a
commit 64d9faed5a
3 changed files with 27 additions and 12 deletions

View File

@@ -0,0 +1,2 @@
PHONE,VALUE,DATE
201-¾᠓𑄺꤈꤈꧐꤆,¹5,2018-0²-27 16:08:39 +0000
1 PHONE VALUE DATE
2 201-¾᠓𑄺꤈꤈꧐꤆ ¹5 2018-0²-27 16:08:39 +0000