Getting A Valueerror: Invalid Literal For Int() With Base 10: '' Error And Don't Know Why
Solution 1:
The int() function is throwing an exception because you are trying to convert something that is not a number.
I suggest that you might consider using debugging print statements to find out what plan's and fiid's are initally and how they change.
Another thing you can do is wrap the call to int() using try/catch
val='a'try:
int_val = int(val)
except ValueError:
print("Failure w/ value " + val)
Solution 2:
Somewhere in that chain of calls, you're passing an empty string which the code is then trying to convert to an integer. Log your input at the time to track it down.
Solution 3:
Suggest you look at the values of plan
and fiid
, because either plan
or fiid
is not set to the value that you think.
Solution 4:
For me, I had to delete the migration folder and follow the steps in the top answer in this link and then re-run the migrations, and then the error went away and it worked.
Post a Comment for "Getting A Valueerror: Invalid Literal For Int() With Base 10: '' Error And Don't Know Why"