stdnum.se.personnummer is_valid is crashing under a given input
[Date Prev][Date Next] [Thread Prev][Thread Next]stdnum.se.personnummer is_valid is crashing under a given input
- From: Avishay Balderman <AvishayB [at] Radware.com>
- To: "python-stdnum-users [at] lists.arthurdejong.org" <python-stdnum-users [at] lists.arthurdejong.org>
- Cc: Noy Haim <NoyHa [at] radware.com>, Ehud Doron <EhudD [at] Radware.com>
- Subject: stdnum.se.personnummer is_valid is crashing under a given input
- Date: Wed, 12 Feb 2020 09:38:20 +0000
Hi Thanks for the great library – it really helps us 😊 I have code that calls the is_valid method of stdnum.se.personnummer. The input I am sending is “breaking” the birthday calculation and I believe should be fixed. The code below reproduces the issue from stdnum.se.personnummer import is_valid The output is: Traceback (most recent call last): File "C:/dev/projects/waf-ai-repo/reproduce_stdnum_issue.py", line 3, in <module> is_valid('19670-19-9535') File "C:\dev\tools\python371\lib\site-packages\stdnum\se\personnummer.py", line 118, in is_valid return bool(validate(number)) File "C:\dev\tools\python371\lib\site-packages\stdnum\se\personnummer.py", line 110, in validate get_birth_date(number) File "C:\dev\tools\python371\lib\site-packages\stdnum\se\personnummer.py", line 73, in get_birth_date month = int(number[4:6]) ValueError: invalid literal for int() with base 10: '0-' Thanks Avishay Sent from Mail for Windows 10 |
- stdnum.se.personnummer is_valid is crashing under a given input, Avishay Balderman
- Re: stdnum.se.personnummer is_valid is crashing under a given input, Sergi Almacellas Abellana
- Prev by Date: Re: Dutch vat numbers do not contain bsn numbers anymore
- Next by Date: Re: stdnum.se.personnummer is_valid is crashing under a given input
- Previous by thread: Re: Dutch vat numbers do not contain bsn numbers anymore
- Next by thread: Re: stdnum.se.personnummer is_valid is crashing under a given input