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

UnicodeDecodeError when reading MDB file #46

Open
bv-do opened this issue Mar 28, 2023 · 0 comments
Open

UnicodeDecodeError when reading MDB file #46

bv-do opened this issue Mar 28, 2023 · 0 comments

Comments

@bv-do
Copy link

bv-do commented Mar 28, 2023

When loading an MDB file, it's throwing a UnicodeDecode error immediately upon reading the first record. It can be reproduced with the "PetStore2000.mdb" or "PetStore2002.mdb" sample databases found at this link: https://jerrypost.com/dbbook/mainbook/Databases/Access/Access.html
(I've been able to read the other sample databases at that link with meza successfully)

Example code:

import meza.io
print("Detected encoding:", meza.io.get_encoding('PetStore2002.mdb'))
records = meza.io.read_mdb('PetStore2002.mdb')
print(next(records))

Output:

Detected encoding: None

Traceback (most recent call last):
  File "/Users/me/Library/Application Support/JetBrains/PyCharm2022.3/scratches/scratch_84.py", line 6, in <module>
    print(next(records))
  File "/Users/me/projects/leaks-tools/splitters/venv/lib/python3.8/site-packages/meza/io.py", line 664, in read_mdb
    first_line = StringIO(str(pipe.readline()))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 268: invalid start byte

It's possible this is the same problem described in #39

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

1 participant