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

Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working #1027

Closed
nkonin opened this Issue Oct 29, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@nkonin

nkonin commented Oct 29, 2018

Affected version: marshmallow-2.16.1

Warning examples:

======================================= warnings summary ========================================
.../python3.7/site-packages/marshmallow/schema.py:5: 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 defaultdict, Mapping, namedtuple

.../python3.7/site-packages/marshmallow/orderedset.py:26: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class OrderedSet(collections.MutableSet):

.../python3.7/site-packages/marshmallow/utils.py:54: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  (isinstance(obj, collections.Iterable) and not hasattr(obj, "strip")) or is_generator(obj)

.../venv/lib/python3.7/site-packages/tornado/httputil.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class HTTPHeaders(collections.MutableMapping):

Maybe it worth to use something like:

try:
    from collections.abc import defaultdict, Mapping, namedtuple
except ImportError:
    from collections import defaultdict, Mapping, namedtuple
@jmargeta

This comment has been minimized.

Contributor

jmargeta commented Oct 30, 2018

@nkonin I came across the same deprecation warnings.
Does the proposed PR solve it for you?

@sloria

This comment has been minimized.

Member

sloria commented Oct 31, 2018

This is released in 2.16.2

@sloria sloria closed this Oct 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment