SolarEdgeTech / pyctuator

Monitor Python applications using Spring Boot Admin
Apache License 2.0
175 stars 17 forks source link

Incompatibility with Flask >= 2.3.x #97

Closed ddavidlorenzo closed 1 year ago

ddavidlorenzo commented 1 year ago

Starting 2.3.0, _json_encoder andjson_decoder attributes on app and blueprint, and the corresponding json.JSONEncoder and JSONDecoder classes, are removed_ (source: https://flask.palletsprojects.com/en/2.3.x/changes/). This produces an error in module pyctuator/impl/flask_pyctuator.py, which attempts to load non-existing module JSONEncoder.

Error trace example:

  File "/home/jboss/.local/lib/python3.11/site-packages/pyctuator/pyctuator.py", line 130, in __init__
    success = framework_integration_function(app, self.pyctuator_impl, customizer)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jboss/.local/lib/python3.11/site-packages/pyctuator/pyctuator.py", line 210, in _integrate_flask
    from pyctuator.impl.flask_pyctuator import FlaskPyctuator
  File "/home/jboss/.local/lib/python3.11/site-packages/pyctuator/impl/flask_pyctuator.py", line 9, in <module>
    from flask.json import JSONEncoder
ImportError: cannot import name 'JSONEncoder' from 'flask.json' (/home/jboss/.local/lib/python3.11/site-packages/flask/json/__init__.py)
linux-china commented 1 year ago

any news? :)

michaelyaakoby commented 1 year ago

will take a look. And if you can send and push-request its even better.

michaelyaakoby commented 1 year ago

Ok, I started working on this, see #99

rlratcliffe commented 1 year ago

it looks like this fix is merged, any plans for a release soon?

michaelyaakoby commented 1 year ago

Sure, was hoping to get the other issues fixed too - will try to get this done by the end of this week.

michaelyaakoby commented 1 year ago

Done, please upgrade to pyctuator 1.1.0