Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask 0.10 incompatibility due to removed JSONHTTPException #218

Closed
glyphobet opened this issue Jun 13, 2013 · 9 comments · Fixed by #228
Closed

Flask 0.10 incompatibility due to removed JSONHTTPException #218

glyphobet opened this issue Jun 13, 2013 · 9 comments · Fixed by #228

Comments

@glyphobet
Copy link
Contributor

With pallets/flask@4c27f7a, Flask 0.10 has removed exceptions.JSONHTTPException.

This means Flask-Restless is incompatible with Flask 0.10, since it imports JSONHTTPException.

======================================================================
ERROR: Failure: ImportError (No module named exceptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/Users/matt/local/src/flask-restless/flask_restless/__init__.py", line 22, in <module>
    from .manager import APIManager
  File "/Users/matt/local/src/flask-restless/flask_restless/manager.py", line 17, in <module>
    from .views import API
  File "/Users/matt/local/src/flask-restless/flask_restless/views.py", line 41, in <module>
    from .exceptions import json_abort
  File "/Users/matt/local/src/flask-restless/flask_restless/exceptions.py", line 14, in <module>
    from flask.exceptions import JSONHTTPException
ImportError: No module named exceptions

From the flask commit, it sounds like there is something wrong with handling exceptions as JSON, but @mitsuhiko doesn't really explain it further than that. A temporary fix would be to require Flask <= 0.9, but a better fix would be to understand what is wrong with JSON exceptions and find a better solution.

@glyphobet
Copy link
Contributor Author

There are now three choices on how to fix this:

@mowliv
Copy link

mowliv commented Jul 8, 2013

Just ran into this myself - what is the plan to fix?

@glyphobet
Copy link
Contributor Author

@mowliv If you would like to use the fork at https://github.com/goodscloud/flask-restless, go ahead, this problem is fixed there.

@jfinkels
Copy link
Owner

jfinkels commented Jul 9, 2013

Hi,

Im out of the country for another week or two so I wont be merging these things for a little while. Sorry for the inconvenience.

@flexd
Copy link

flexd commented Jul 22, 2013

Are you back yet? :-) I'd rather not run someones fork and then forget to change it back later.

@flexd
Copy link

flexd commented Jul 23, 2013

@glyphobet What if #212 is implemented to have a working flask-restless, and then a better solution can be made later?

@glyphobet
Copy link
Contributor Author

@flexd I fixed it in my branch with #228, because that seemed the least invasive. #212 is an alternative solution, but there would be no reason to do both. The author of Flask says #212 is a flawed design so I prefer #228.

@alexcouper
Copy link

I just opened #231 and then saw this thread and closed it. slow claps himself

For what it's worth, I too prefer #228.

@jfinkels
Copy link
Owner

I will use #228.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants