Comments (4)
I wasn't able to reproduce this in my test app using SQLite. Can you provide some more details on your app & environment, including the versions of Flask-SQLAlchemy and SQLAlchemy you're using and the database driver used. It might also help to narrow it down to a small test app that exhibits the problem, such as if it happens to occur only with custom SQL queries instead of SQLAlchemy ORM queries.
from flask-debugtoolbar.
Sorry for the late reply, I'm using MySQL 5.5.34 and Python 3.3.1 on Ubuntu 13.04, here are some details:
Flask==0.10.1
Flask-DebugToolbar==0.9.0
Flask-SQLAlchemy==1.0
SQLAlchemy==0.8.2
Werkzeug==0.9.4
cymysql==0.6.7
The error happens even on the simplest (SQLAlchemy ORM) of queries. I added an "print(statement)" as first line in dump_query ("../panels/sqlalchemy.py", line 25), right before the "startswith" error is triggered. This is what I got, for a single get-by-id SQLAlchemy ORM query view:
b'SELECT resource.id AS resource_id, resource.type AS resource_type, resource.name AS resource_name \nFROM resource \nWHERE resource.id = %s'
The "statement" seems to be a "bytes literal" at this point in execution: "Bytes literals are always prefixed with 'b' or 'B'; they produce an instance of the bytes type instead of the str type", and apparently startswith cannot check if a "byte literal" starts with a str, hence the error. Some type cast probably would fix the issue, but I'm not sure where is the right place to do the cast.
from flask-debugtoolbar.
Please try this fix. It should handle SQL queries passed as bytes
values.
from flask-debugtoolbar.
Works great, many thanks!
from flask-debugtoolbar.
Related Issues (20)
- Migrate the repo to `pallets-eco/flask-debugtoolbar` HOT 1
- Update CI workflows
- Modernize our packaging metadata files HOT 1
- New release incorporating the Flask-SQLAlchemy 3.x changes HOT 4
- Drop support for python 2 HOT 1
- Subdomains support HOT 2
- quickstart broken link
- Not working for subdmains - blocked by chrome/firefox because of http instead of https HOT 2
- '_request_ctx_stack' is deprecated and will be removed in Flask 2.3 HOT 3
- Breaks with Flask 2.3.0 (okay with 2.3.1) HOT 1
- Scrollbar not appearing HOT 1
- More help with reviewers/committers/maintainers? HOT 3
- flask-debugtoolbar is incompatible with newest version of werkzeug. HOT 2
- 0.13.1 breaks with Flask 3.0: ImportError: cannot import name '_request_ctx_stack' from 'flask.globals HOT 7
- 0.13.1 breaks on werkzeug 3: Response' object has no attribute 'charset HOT 1
- Drop support for Flask < 2.2.0 (and implicitly Python < 3.7) HOT 2
- Add a basic integration test that ensures the python package is installable HOT 5
- ReadTheDocs builds are broken HOT 2
- Address Flask 3.0 deprecation warnings on using __version__ (to be removed in Flask 3.1) HOT 2
- sql_select/sql_explain not working with Flask-SQLAlchemy 3 & SQLAlchemy 2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-debugtoolbar.