I run a flask server with sqlalchemy connecting to an sqlite database.
To update my database tables I exported my data to a file, updated the necessary tables and then imported the data again. This data in the database is all correct and in the right place.
The problem is in the passwords, they are stored as a blob (largebinary in sqlalchemy).
When creating a new account with a password, the account works immediately without any problems.
However all the old passwords that I have imported from the old database do not work anymore and throw an error. The error that gets thrown is the following: 
TypeError: string argument without an encoding
The type of the new passwords in the database is what it should be:
<class 'bytes'>
With the migrated passwords, I can not even check what type it is, as it throws the TypeError during retrieval of this field.
The data is stored as a blob: password BLOB NOT NULL
A not working password: $2b$12$CC6OVZTOy3Bc9bsxAeALpuJPc.iZmVwXFB/Cj6.xRlgF2dRdTh11y
A working password:
$2b$12$NL8reAO7rx1NC5DwgeWVt.ojV0I6czlOKcXAOF87L5NoVsdmOulle
As it turns out the tool I was using did not correctly export the data. The binary data then got lost as sqlite does not have a hard type enforcing.
I fixed this by exporting the data again and manually converting all the strings to their character representation and importing it again.
Sqlalchemy largebinary does not have an encoding after migrating data