Skip to content

Inconsistency opening a database #9

@robgmac

Description

@robgmac

I have a function to open several databases (called tables in the code). They all open except the one called "Transaction" that is using the same code as the others. Since Python 3 uses Unicode, I tried encoding the file path with utf-8 and utf-16 which throws a different error.
I have attached the pertinent code and the responding error.

def connection(self):
""" Establish a connection to the data base"""
file_ = os.path.join(self.path, "Param")
self.param_table = Base(file_)
self.param_table.open()
file_ = os.path.join(self.path, "Account")
self.acct_table = Base(file_)
self.acct_table.open()
file_ = os.path.join(self.path, "Transaction")
self.tran_table = Base(file_)
self.tran_table.open() 'this is line 48 that throws the error'
file_ = os.path.join(self.path, "JEntry")
self.entry_table = Base(file_)
self.entry_table.open()
file_ = os.path.join(self.path, "Vendors")
self.vendor_table = Base(file_)
self.vendor_table.open()
file_ = os.path.join(self.path, "Budget")
self.budget_table = Base(file_)
self.budget_table.open()
file_ = os.path.join(self.path, "Reports")
self.report_table = Base(file_)
self.report_table.open()

`File "/home/robert/MEGA/workspacePy3/pythonProject/src/Core/data.py", line 48, in connection
self.tran_table.open()

File "/home/robert/MEGA/workspacePy3/pythonProject/lib/python3.10/site-packages/PyDbLite-3.0.4/pydblite/pydblite.py", line 243, in open
self.records = pickle.load(_in)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 1: ordinal not in range(128)
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions