sqlalchemy insert - string argument without an encoding
问题 The code below worked when using Python 2.7, but raises a StatementError when using Python 3.5. I haven't found a good explanation for this online yet. Why doesn't sqlalchemy accept simple Python 3 string objects in this situation? Is there a better way to insert rows into a table? from sqlalchemy import Table, MetaData, create_engine import json def add_site(site_id): engine = create_engine('mysql+pymysql://root:password@localhost/database_name', encoding='utf8', convert_unicode=True)