RSS feed

Re: is_valid is crashing under a given input

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: is_valid is crashing under a given input


It seems that your number is wrong. You are using 19670- as birdth date but is this is only 5 digits while it should be 6.

Am I right?

El 12/2/20 a les 10:38, Avishay Balderman ha escrit:


Thanks for the great library – it really helps us 😊


I have code that calls the is_valid method of

The input I am sending is “breaking” the birthday calculation and I believe should be fixed.

The code below reproduces the issue


from import is_valid



The output is:


Traceback (most recent call last):

  File "C:/dev/projects/waf-ai-repo/", line 3, in <module>


  File "C:\dev\tools\python371\lib\site-packages\stdnum\se\", line 118, in is_valid

    return bool(validate(number))

  File "C:\dev\tools\python371\lib\site-packages\stdnum\se\", line 110, in validate


  File "C:\dev\tools\python371\lib\site-packages\stdnum\se\", line 73, in get_birth_date

    month = int(number[4:6])

ValueError: invalid literal for int() with base 10: '0-'








Sent from Mail for Windows 10


Sergi Almacellas Abellana
Twitter: @pokoli_srk