Share

dbfpy

Tracker: Feature Requests

5 exception decoding ^@ padded numeric field - ID: 2796419
Last Update: Comment added ( a1s )

we've got a dbf where numeric fields are padded with <NUL> characters. on
these the library crashes:

File "/usr/local/lib/python2.6/dist-packages/dbfpy/fields.py", line 240,
in decodeValue
# a float (has decimal separator)
ValueError: null byte in argument for float()

I would add this line just after stripping the value, before converting it
to float/integer:
value = value.replace('\0', '')


Mario Frasca ( mfrasca ) - 2009-05-25 13:12

5

Closed

None

Nobody/Anonymous

None

None

Public


Comments ( 2 )

Date: 2009-05-26 05:36
Sender: a1sProject Admin

done in version 2.2.4


Date: 2009-05-25 15:11
Sender: mfrasca

or even better, put this feature request under 'bugs', because it's there
where it belongs...
and maybe
value=value.strip(" \0")


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2009-05-26 05:36 a1s
allow_comments 1 2009-05-26 05:36 a1s
close_date - 2009-05-26 05:36 a1s