Giter Club home page Giter Club logo

Comments (6)

pgjones avatar pgjones commented on July 18, 2024

Hello, I think the issue is that you have combined imports in from quart import Quart,flask_patch, rather I think you should have import quart.flask_patch first before any other imports. I've hopefully made this clear in these docs.

from quart.

myaspm avatar myaspm commented on July 18, 2024

Hello Again,

I'm following your process steps but It's not change anything. I moved app=Quart("test") to first row processed in run.py.
It works succesfully to default but it's return again the same error on docker.

New code block :

# coding:utf-8


from quart import flask_patch
from quart import (
    Quart,
    Blueprint,
    session,
    request,
    render_template,
    jsonify
)
app = Quart("test")

from app import create_app
app = create_app(app=app)

app.run(host='0.0.0.0', port=5001, threaded=True, debug=True)

and same error

Recreating seffaflik_seffaflik_1 ... done
Attaching to seffaflik_seffaflik_1
seffaflik_1  | Traceback (most recent call last):
seffaflik_1  |   File "run.py", line 4, in <module>
seffaflik_1  |     from quart import flask_patch
seffaflik_1  |   File "/usr/local/lib/python3.6/site-packages/quart/flask_patch/__init__.py", line 5, in <module>
seffaflik_1  |     patch_all()
seffaflik_1  |   File "/usr/local/lib/python3.6/site-packages/quart/flask_patch/_patch.py", line 83, in patch_all
seffaflik_1  |     _patch_modules()
seffaflik_1  |   File "/usr/local/lib/python3.6/site-packages/quart/flask_patch/_patch.py", line 64, in _patch_modules
seffaflik_1  |     for name, module in sys.modules.items():
seffaflik_1  | RuntimeError: dictionary changed size during iteration
seffaflik_seffaflik_1 exited with code 1

from quart.

pgjones avatar pgjones commented on July 18, 2024

Hmm, I can't seem to reproduce this. Is this the main file or is it imported from another? In addition is import quart.flask_patch the very first line (bar comments) in the file? Also can you try with import quart.flask_path rather than the from version?

from quart.

myaspm avatar myaspm commented on July 18, 2024

Yes this code is main file. I'm running this code with python run.py. And I changed from quart import flask_patch the import quart.flask_patch but I get the same error. When I look at the flask extensions you support , I use flask-mongoengine library you do not support. Actually I work in normal mode without any trouble, but I get an error on the docker.And I import this mongoengine after import quart.flask_patch.
And there is one more thing. If I delete import quart.flask_patch on default mode then I get this following error

Traceback (most recent call last):
  File "run.py", line 6, in <module>
    app = create_app()
  File "/home/hanbey/workspaces/python/seffaflik/app/app.py", line 51, in create_app
    configure_extensions(app)
  File "/home/hanbey/workspaces/python/seffaflik/app/app.py", line 74, in configure_extensions
    db.init_app(app)
  File "/home/hanbey/.local/share/virtualenvs/seffaflik-2oDz6vDS/lib/python3.6/site-packages/flask_mongoengine/__init__.py", line 111, in init_app
    raise Exception('Invalid Flask application instance')
Exception: Invalid Flask application instance

So I can not delete import quart.flask_patch.

from quart.

pgjones avatar pgjones commented on July 18, 2024

I think this should be fixed with 0c64f50, could you try it?

from quart.

pgjones avatar pgjones commented on July 18, 2024

I'm going to assume this is fixed in the latest release, 0.6.5, please reopen if it isn't.

from quart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.