Skip to content

Separate collections from collections.abc#4501

Merged
nateprewitt merged 1 commit intopsf:masterfrom
rhettinger:master
Jun 12, 2018
Merged

Separate collections from collections.abc#4501
nateprewitt merged 1 commit intopsf:masterfrom
rhettinger:master

Conversation

@rhettinger
Copy link
Copy Markdown
Contributor

In Python 3.7, there is a warning that the abstract bases in collections.abc will no longer be accessible through the regular collections module in Python 3.8. This patch future-proofs requests.

I wasn't able to run the test suite locally, so this needs a thorough test going forward.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 5, 2018

Codecov Report

Merging #4501 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4501      +/-   ##
==========================================
- Coverage   90.18%   90.15%   -0.03%     
==========================================
  Files          15       15              
  Lines        1548     1544       -4     
==========================================
- Hits         1396     1392       -4     
  Misses        152      152
Impacted Files Coverage Δ
requests/models.py 93.66% <100%> (-0.02%) ⬇️
requests/cookies.py 77.02% <100%> (-0.1%) ⬇️
requests/structures.py 100% <100%> (ø) ⬆️
requests/sessions.py 95.62% <100%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8da118d...15e1139. Read the comment docs.

Copy link
Copy Markdown
Member

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rhettinger, thanks for contributing to Requests! This looks like it will resolve #4494 by fixing the namespace deprecation for Python 3.7. I'd like another maintainer to approve this PR before merging, but I believe this looks good from my end.

from http.cookies import Morsel
from io import StringIO
from collections import OrderedDict
from collections.abc import Callable, Mapping, MutableMapping
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhettinger on which versions of Python 3 will this actually succeed on? It was my impression that collections.abc was introduced in 3.6 or 3.7.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sigmavirus24 I'd tested it back to 3.4 without issue, so I think this should work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works back to Python 3.3.

@sigmavirus24
Copy link
Copy Markdown
Contributor

This branch is also out-of-date with master and will need to be updated

@nateprewitt
Copy link
Copy Markdown
Member

Hey @rhettinger, would you mind rebasing this onto current master? Assuming @sigmavirus24 doesn't have further issues, I think we're set to merge this.

@sigmavirus24 sigmavirus24 dismissed their stale review May 14, 2018 00:33

outdated

@nateprewitt nateprewitt merged commit 7e297ed into psf:master Jun 12, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants