You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrading my platform from Python 3.8 + Flask 3.0.3 + Flask-Session 0.8.0 with redis backend, to Python 3.11 + Flask 3.1.0 + Flask-Session 0.8.0 with redis backend. Same user code.
Issue: fancy flash message breaks on the new platform (work fine on the old platform).
Flash message: flash(Markup('press the play button <i class="bi-play-btn-fill black"></i> below'), 'info')
Error:
[2024-12-10 19:01:28,998] ERROR in base: Failed to serialize session data: Encoding objects of type Markup is unsupported
[2024-12-10 19:01:28,998] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 920, in full_dispatch_request
return self.finalize_request(rv)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 941, in finalize_request
response = self.process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 1322, in process_response
self.session_interface.save_session(self, ctx.session, response)
File "/var/www/lib/python3.11/site-packages/flask_session/base.py", line 305, in save_session
self._upsert_session(app.permanent_session_lifetime, session, store_id)
File "/var/www/lib/python3.11/site-packages/flask_session/redis/redis.py", line 78, in _upsert_session
serialized_session_data = self.serializer.encode(session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask_session/base.py", line 132, in encode
return self.encoder.encode(dict(session))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Encoding objects of type Markup is unsupported
[2024-12-10 19:01:29,002] ERROR in base: Failed to serialize session data: Encoding objects of type Markup is unsupported
[2024-12-10 19:01:29,002] ERROR in app: Request finalizing failed with an error while handling an error
Traceback (most recent call last):
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 920, in full_dispatch_request
return self.finalize_request(rv)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 941, in finalize_request
response = self.process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 1322, in process_response
self.session_interface.save_session(self, ctx.session, response)
File "/var/www/lib/python3.11/site-packages/flask_session/base.py", line 305, in save_session
self._upsert_session(app.permanent_session_lifetime, session, store_id)
File "/var/www/lib/python3.11/site-packages/flask_session/redis/redis.py", line 78, in _upsert_session
serialized_session_data = self.serializer.encode(session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask_session/base.py", line 132, in encode
return self.encoder.encode(dict(session))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Encoding objects of type Markup is unsupported
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 941, in finalize_request
response = self.process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask/app.py", line 1322, in process_response
self.session_interface.save_session(self, ctx.session, response)
File "/var/www/lib/python3.11/site-packages/flask_session/base.py", line 305, in save_session
self._upsert_session(app.permanent_session_lifetime, session, store_id)
File "/var/www/lib/python3.11/site-packages/flask_session/redis/redis.py", line 78, in _upsert_session
serialized_session_data = self.serializer.encode(session)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/lib/python3.11/site-packages/flask_session/base.py", line 132, in encode
return self.encoder.encode(dict(session))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Encoding objects of type Markup is unsupported
The text was updated successfully, but these errors were encountered:
Upgrading my platform from Python 3.8 + Flask 3.0.3 + Flask-Session 0.8.0 with redis backend, to Python 3.11 + Flask 3.1.0 + Flask-Session 0.8.0 with redis backend. Same user code.
Issue: fancy flash message breaks on the new platform (work fine on the old platform).
Flash message:
flash(Markup('press the play button <i class="bi-play-btn-fill black"></i> below'), 'info')
Error:
The text was updated successfully, but these errors were encountered: