Bug: Reading (decoding) values '' with dbfpy
Module: fields.py
Function: decodevalue()
Description:
When a DBF-file has the * (, **, ...) character in one of the fields, an error message appears
'invalid literal for int() with base 10: '***' '
I propose the following change to the decode function:
defdecodeValue(self,value):"""Return a number decoded from ``value``. If decimals is zero, value will be decoded as an integer; or as a float otherwise. Return: Return value is a int (long) or float instance."""value=value.strip(" \0")if"."invalue:# a float (has decimal separator)returnfloat(value)# NEW francisgg: * per whitespacesif"*"invalue:value=value.replace('*',' ')returnvalueelifvalue:# must be an integer returnint(value)else:return0
Finally, I am a beginner and I hope your opinion.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Bug: Reading (decoding) values '' with dbfpy
Module: fields.py
Function: decodevalue()
Description:
When a DBF-file has the * (, **, ...) character in one of the fields, an error message appears
'invalid literal for int() with base 10: '***' '
I propose the following change to the decode function:
Finally, I am a beginner and I hope your opinion.