pallets-eco / flask-debugtoolbar

A toolbar overlay for debugging Flask applications
https://flask-debugtoolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
953 stars 146 forks source link

Python 3 compatibility #54

Closed justinmayer closed 11 years ago

justinmayer commented 11 years ago

Recent updates to Flask and related components have included support for Python 3, and it would be great to be able to use Flask-DebugToolbar in projects running on Python 3. As it stands now, Flask-DebugToolbar must be disabled in such projects in order to run them without errors.

Are there plans to support Python 3 in the near future?

arsenetar commented 11 years ago

Running 2to3 seems to fix most issues... leaving just line 9 in templates/panels/headers.html. At least everything seems to be working for me at this point with running 2to3 and that edit.

-       {% for key, value in headers.iteritems() %}
+       {% for key, value in headers.items() %}
jacobsvante commented 11 years ago

Does anyone have a branch with py3 compatibility?

justinmayer commented 11 years ago

Great to see Python 3 support has landed. Thanks, Matt!

Do you think you might be able to push out a release in the near future?

mgood commented 11 years ago

This probably needs some more testing, but I've added a tentative fix. I'm following @mitsuhiko's approach to using one codebase that's compatible with 2.6, 2.7 and 3.3+, so 2to3 is not required.

I'd been trying to come up with a better comprehensive testing approach, but for now I've checked in a really basic sanity test that checks that the toolbar at least loads for a very simple app. It can be run locally with Tox, or automated results are in Travis CI:

https://travis-ci.org/mgood/flask-debugtoolbar

jacobsvante commented 11 years ago

Great job @mgood. This got rid of the exceptions thrown during tox testing, though I haven't had time to test it manually yet but I'll report back if I find any issues.

mgood commented 11 years ago

Yeah, I'd appreciate you trying it out before I make a new release. I've only tested it with fairly trivial example apps since I don't have another app running with Python 3 yet.

jacobsvante commented 11 years ago

Seems to be working great here, no issues so far!

justinmayer commented 11 years ago

Tested here and functioning precisely as expected. Well done!

justinmayer commented 10 years ago

Hey Matt. Any possibility of releasing a new version of Flask-DebugToolbar? Would be great to have a released version that supports Python 3.3.

justinmayer commented 10 years ago

Given that it's been nearly a year since the last release, is there any chance of a new Flask-DebugToolbar release soon? Anything I can do to help?

jacobsvante commented 10 years ago

Working well for at least me and @justinmayer so this should be safe to release. This is a package that is used under development environments only so IMHO there'd be no great harm if a bug was found at a later stage.

mgood commented 10 years ago

Sorry for the delay. I just uploaded version 0.9.0 with this and other changes. Thanks for the help and testing.

eirnym commented 10 years ago

Will you add 'Programming Language :: Python :: 3' classifier?