Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_date do not raise Exception on incorrect string (GPS format) #63

Open
maximeLeurent opened this issue Nov 13, 2020 · 1 comment
Open

Comments

@maximeLeurent
Copy link

Hello,

I found that on some value of string , parse_date do not raise an Exception where it should. As i am using it in json hook it is problematique.

Example:

isodate.parse_date("16.263772,-61.2329")
datetime.date(1601, 1, 1)

isodate.parse_date("100.263772,-61.2329")
datetime.date(1001, 1, 1)

it does the same for any two (or more) digits number in before "."

Whereas date.fromisoformat do raise an error on those values.

I don't know if you will considere that as an issue.

Regards.

@Gianfranco753
Copy link

I was just trying something similar.

>>> isodate.parse_date('202hghf01217gg')
datetime.date(2001, 1, 1)

But, if I throw gibberish on the start of the string, it raises an exception.

>>> isodate.parse_date('gfgf202hghf01217gg')
isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: 'gfgf202hghf01217gg'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants