dbfread
dbfread copied to clipboard
Fix for DBF failing on null dates
edited date field parsing to handle NULL values
Thanks!
Could you give me an example of the value you're getting? It looks to me like you could have null bytes inside the value?
Some notes:
- There's no need to decode the value here. You can split and join
bytes
object. - Wouldn't a
replace()
do the same thing? - The out parentheses are not needed.
So this should work:
if data.replace(b'\x00', b'') == b'' or data.strip(b' 0') == b'':
Sorry if that was a lot for such a small change. :-) Just want to make sure that I get this right.
Could you test @william-andre's fix in pull request #35? His solution is even simpler. I hope it will work for you as well.
if data.strip(b' 0\0') == b''