question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated

See original GitHub issue

Referencing collections.MutableMapping rather than collections.abc.MutableMapping triggers a deprecation warning.

>>> import botocore
>>> botocore.__version__
'1.13.15'
>>> import collections
>>> collections.MutableMapping
__main__:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

The reference occurs here: https://github.com/boto/botocore/blob/develop/botocore/awsrequest.py#L624

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
swetashrecommented, Nov 15, 2019

Sorry for the late reply. We are working on a fix for it. I will update here when it will be fixed.

2reactions
clifflucommented, Nov 13, 2019

It seems to be a different issue as I got the same Deprecation Warning from awsrequest.py:624 , not the vendored requests. botocore.version = ‘1.13.16’

Changing

class HeadersDict(collections.MutableMapping):
...

to

try:
    from collections.abc import MutableMapping
except ModuleNotFoundError:
    from collections import MutableMapping

class HeadersDict(MutableMapping):
...

fixes this warning and is pythonic IMHO. Pytest will then throw the same DeprecationWarning from session.py:947 instead.

I can create a PR for it if you like : )

Update: Should replace ModuleNotFoundError with ImportError as the former was introduced in Python 3.6, and is subclass to ImportError.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use collections.abc from both Python 3.8+ and Python ...
abc' is deprecated, and in 3.8 it will stop working elif isinstance(value, (collections.MutableMapping, collections.MutableSequence)) == True:.
Read more >
Using or importing the ABCs from 'collections' instead ... - GitHub
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working #1401.
Read more >
Issue #50032: Using or importing the ABCs from 'collections ...
Issue #50032: Using or importing the ABCs from 'collections' instead of from 'collections. abc' is deprecated in Python 3.7 - 389-ds-base - Pagure.io....
Read more >
Bug #1936667 “Using or importing the ABCs from 'collections ...
Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3 ; OpenStack Object Storage (swift).
Read more >
Using or importing the ABCs from 'collections' instead of from ...
Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working. Closed, ResolvedPublic.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found