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.

Python 3.7: DeprecationWarning from collections

See original GitHub issue

Seeing warnings when importing responses in Python 3.7:

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 namedtuple, Sequence, Sized

A cookies deprecation warning is shown as well, it has been reported earlier in https://github.com/getsentry/responses/issues/186.

Steps to reproduce

Create file test_responses.py:

import warnings
warnings.filterwarnings(module='.*', action='default')
import responses

With Python 3.7 execute the file and notice the output:

$ python -V
Python 3.7.0
$ python tests/test_responses.py
/Users/kristofferb/.testvenv/py37responses/lib/python3.7/site-packages/responses.py:11: 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 namedtuple, Sequence, Sized
/Users/kristofferb/.testvenv/py37responses/lib/python3.7/site-packages/cookies.py:312: DeprecationWarning: Flags not at the start of the expression '(?ix)  # Case-insens' (truncated)
  ATTR_RE = re.compile(ATTR)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
adamchainzcommented, Oct 20, 2018

The formatargspec warning still occurs on Python 3.7 for me, I’m working on a PR rn.

1reaction
bcbcommented, Oct 5, 2018

Also seeing these in 3.7:

/Users/beau/personal/jsonrpcclient/.tox/py37/lib/python3.7/site-packages/responses.py:117: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  signature = inspect.formatargspec(args, a, kw, defaults)

/Users/beau/personal/jsonrpcclient/.tox/py37/lib/python3.7/site-packages/responses.py:121: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  callargs = inspect.formatargspec(args, a, kw, None)

/Users/beau/personal/jsonrpcclient/.tox/py37/lib/python3.7/site-packages/responses.py:117: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  signature = inspect.formatargspec(args, a, kw, defaults)

/Users/beau/personal/jsonrpcclient/.tox/py37/lib/python3.7/site-packages/responses.py:121: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  callargs = inspect.formatargspec(args, a, kw, None)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3.7 deprecation warning on collections.Mapping import
Since 3fa8630, parso uses from collections import Mapping, but that's deprecated since Python 3.7: DeprecationWarning: Using or importing ...
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 >
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 >
What's New In Python 3.7 — Python 3.11.1 documentation
This article explains the new features in Python 3.7, compared to 3.6. Python 3.7 was released on June 27, ... PEP 565, improved...
Read more >
python3-gssapi raises deprecation warning on Python 3.7
Description of problem: Python 3.7 has deprecated ABCs in the collection module. Instead you have to import ABCs from collections.abs.
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