Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dBase III support #1

Open
koljenovic opened this issue Jun 23, 2021 · 5 comments
Open

dBase III support #1

koljenovic opened this issue Jun 23, 2021 · 5 comments

Comments

@koljenovic
Copy link

  • Python version: 3.9.5
  • Operating System: Linux *** 5.11.0-18-generic #19-Ubuntu SMP Fri May 7 14:22:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Description

dBase III with/without memo (version byte 0x83/0x03) errors out at Dbf instantiation with:

ValueError: dbf fields definition is corrupt, fields start does not match.

What I Did

I will try dBase integration.

@frankyxhl
Copy link
Owner

Hi,

Can you share you example DBF file?

@koljenovic
Copy link
Author

Sample file attached.

dbase_error_210623.tar.gz

@koljenovic
Copy link
Author

Please note fields.parse declaration:

def parse(cls, string, ignore_errors=False):

and invocation from the header constructor:

field = DbfFields.parse(data, pos)

There is a parameter/argument mismatch here, also pos should have nothing to do with header offseting, so I believe it to be used incorrectly in this case. After fixing the parse invocation to exclude pos and deleting:

dbfpy3/dbfpy3/header.py

Lines 157 to 161 in 41e519a

if pos != field.start:
raise ValueError(
'dbf fields definition is corrupt, '
'fields start does not match.'
)

headers get to parse just fine, but using a file that contains data records another error gets raised when record.py starts parsing the data:

ValueError: ('Record deleted flag error ({})', 0)

I'll try to dig further, I suspect it might have something to do with offsetting as well.

@frankyxhl
Copy link
Owner

dBase III file format might be a little different:

https://www.clicketyclick.dk/databases/xbase/format/dbf.html#DBF_NOTE_6_SOURCE

@lyx0723
Copy link

lyx0723 commented Jan 5, 2024 via email

@github-staff github-staff deleted a comment from flexipgroup May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants