Skip to content

DeprecationWarning in flask.sessions #3053

Closed
@tirkarthi

Description

@tirkarthi

flask.session imports MutableMapping from collections which is deprecated in Python 3.7 and will be removed in 3.8. For some reason since there are similar warnings in other libraries like werkzeug and jinja that are fixed seems to hide this warning. Importing session directly from flask folder causes this warning

Expected Behavior

DeprecationWarning should not be shown since it causes incompatibility with 3.8

Actual Behavior

Tell us what happens instead.

Python 3.8.0a0 (heads/master:78de01198b, Dec 29 2018, 11:36:21)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import warnings
>>> warnings.filterwarnings("default", category=DeprecationWarning)
>>> import sessions
/home/karthi/flask/flask/sessions.py:14: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableMapping

Environment

  • Python version: Python 3.8.0a0
  • Flask version: 1.1dev
  • Werkzeug version: 0.14

Upstream PR : python/cpython#10596

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions