Open DenisKuplyakov opened 7 years ago
The stack trace is from the SQLAlchemy panel, so I think the issue is with serializing one of your SQL query parameters, not necessarily with the URL.
What parameters are you passing to the SQL query? Also, what version of the extensions are you using?
I have some models with UUID as their primary key. I use UUID type from SQLAlchemy-Utils package. Endpoints that uses UUID in URL have queries by UUID from the tables.
Versions of packages that may be interesting (actually there is more stuff like redis, marshmallow, etc.):
Flask==0.12.1
Flask-DebugToolbar==0.10.1
Flask-SQLAlchemy==2.2
Flask-UUID==0.2
SQLAlchemy==1.1.9
SQLAlchemy-Utils==0.32.14
You are right, the real problem is random UUIDs that are serialized to strings and inserted to queries. As a result such strings contain invalid utf-8 characters. Below is the example:
[
u'SELECT client.id AS client_id, client.name AS client_name \nFROM client \nWHERE client.id = %s',
('s\xa7Gf\x0f\xadEL\x87\xef{$ya2t')
]
Now I'm using toolbar with sqlalchemy panel disabled. Why debug toolbar tries to dump list with query and parameters to json?
Thanks for the good extension that helps a lot!
I have problems using it with Flask-UUID extension and URLs that have UUIDs inside. Is it possible to fix this? Providing stack trace below: