Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3

Bug #1936667 reported by Rodolfo Alonso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Undecided
Takashi Kajinami
OpenStack Identity (keystone)
Fix Released
Undecided
Takashi Kajinami
OpenStack Object Storage (swift)
Fix Released
Undecided
Takashi Kajinami
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Takashi Kajinami
neutron
Fix Released
Low
Rodolfo Alonso
tacker
Fix Released
Low
Takashi Kajinami
taskflow
Fix Released
Undecided
Takashi Kajinami
tempest
Fix Released
Undecided
Takashi Kajinami
zaqar
Fix Released
Undecided
Takashi Kajinami

Bug Description

Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3.

For example:

>>> import collections
>>> collections.Iterable
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
<class 'collections.abc.Iterable'>

>>> from collections import abc
>>> abc.Iterable
<class 'collections.abc.Iterable'>

Changed in neutron:
importance: Undecided → Low
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/801068

Changed in neutron:
status: New → In Progress
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

I've added some other components with the same issue.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/mistral/+/801078

Changed in mistral:
status: New → In Progress
Changed in manila:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/manila/+/801079

Changed in zaqar:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zaqar (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/zaqar/+/801080

Changed in mistral:
assignee: nobody → Takashi Kajinami (kajinamit)
Changed in manila:
assignee: nobody → Takashi Kajinami (kajinamit)
Changed in zaqar:
assignee: nobody → Takashi Kajinami (kajinamit)
Changed in taskflow:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to taskflow (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/taskflow/+/801081

Changed in taskflow:
status: New → In Progress
Changed in tempest:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tempest/+/801082

Changed in tempest:
status: New → In Progress
Changed in keystone:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/keystone/+/801083

Changed in keystone:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-lib (master)
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

The following command would detect what we should replace...

egrep -r -e 'collections\.(Awaitable|Coroutine|AsyncIterable|AsyncIterator|AsyncGenerator|Hashable|Iterable|Iterator|Generator|Reversible|Sized|Container|Callable|Collection|Set|MutableSet|Mapping|MutableMapping|MappingView|KeysView|ItemsView|ValuesView|Sequence|MutableSequence|ByteString)' --exclude-dir .tox --exclude-dir doc .

no longer affects: cinder
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

I added cinder but I noticed it imports collections.abc as collections ...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/swift/+/801095

Changed in swift:
status: New → In Progress
Changed in swift:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest-lib (master)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to taskflow (master)

Reviewed: https://review.opendev.org/c/openstack/taskflow/+/801081
Committed: https://opendev.org/openstack/taskflow/commit/05bdafd3a4430d9c94f5433656050cfeb9094584
Submitter: "Zuul (22348)"
Branch: master

commit 05bdafd3a4430d9c94f5433656050cfeb9094584
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:34:19 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: Ia6316894a67cc0ea7ee0d2110565b45546c813e7

Changed in taskflow:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/c/openstack/swift/+/801095
Committed: https://opendev.org/openstack/swift/commit/775ad9a56882b387e834eae7635f9f1ffa7c2f2c
Submitter: "Zuul (22348)"
Branch: master

commit 775ad9a56882b387e834eae7635f9f1ffa7c2f2c
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 01:07:54 2021 +0900

    Remove redundant usage of collections(.abc).Mapping

    The json.loads method returns a normal python dict without any hook
    defined, and type check using the Mapping class is redundant.

    In Python 3.8
    >>> import json
    >>> type(json.loads('{"foo": {"var": "baz"}}'))
    <class 'dict'>

    In Python 2.7
    >>> import json
    >>> type(json.loads('{"foo": {"var": "baz"}}'))
    <class 'dict'>

    With this change we don't have to handle difference between Python 2
    and Python 3 and later about import path we should use to import that
    abstract class

    Closes-Bug: #1936667
    Change-Id: I9232311784d1feff2d669455dafde17ed9f751ad

Changed in swift:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/801068
Committed: https://opendev.org/openstack/neutron/commit/e961c6d4734ec2336ba807e4c7aa77bdc354e2d3
Submitter: "Zuul (22348)"
Branch: master

commit e961c6d4734ec2336ba807e4c7aa77bdc354e2d3
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Jul 16 14:27:15 2021 +0000

    Import ABC classes from collection.abc

    ABC classes should be imported from "collections.abc", not
    "collections".

    Closes-Bug: #1936667
    Change-Id: I863f21b310fdf39030b13e2926e947b16043851a

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-lib (master)

Reviewed: https://review.opendev.org/c/openstack/neutron-lib/+/801084
Committed: https://opendev.org/openstack/neutron-lib/commit/e4b53b1fd1f5a7a32e32fb875592b44f9ba50497
Submitter: "Zuul (22348)"
Branch: master

commit e4b53b1fd1f5a7a32e32fb875592b44f9ba50497
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:45:34 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: I018963cbca6ce4c4e0045be0c78f9cd2aa942d45

no longer affects: cinder
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/tacker/+/801760

Changed in tacker:
status: New → In Progress
Changed in manila:
importance: Undecided → Low
milestone: none → xena-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/c/openstack/manila/+/801079
Committed: https://opendev.org/openstack/manila/commit/c03f96ffaeb64e8cd374b6ed15d24cc21fdec034
Submitter: "Zuul (22348)"
Branch: master

commit c03f96ffaeb64e8cd374b6ed15d24cc21fdec034
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:16:26 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: Ie82a523b4f8ab3d44d0fc9d70cb1ca6c059cc48f

Changed in manila:
status: In Progress → Fix Released
Changed in tacker:
assignee: nobody → Takashi Kajinami (kajinamit)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.28.0

This issue was fixed in the openstack/swift 2.28.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tempest-lib (master)

Change abandoned by "Takashi Kajinami <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/tempest-lib/+/801096

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.opendev.org/c/openstack/tempest/+/801082
Committed: https://opendev.org/openstack/tempest/commit/6354f6182a98b16ecc2a258ac5ab38b7ae92503a
Submitter: "Zuul (22348)"
Branch: master

commit 6354f6182a98b16ecc2a258ac5ab38b7ae92503a
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:37:34 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: Ie660b2e4c7dac05822e13b47335620815a7ad1cf

Changed in tempest:
status: In Progress → Fix Released
Yasufumi Ogawa (yasufum)
Changed in tacker:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron-lib 2.13.0

This issue was fixed in the openstack/neutron-lib 2.13.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zaqar (master)

Reviewed: https://review.opendev.org/c/openstack/zaqar/+/801080
Committed: https://opendev.org/openstack/zaqar/commit/24538768a6ff007ca37a0be2fbddb3086eb01694
Submitter: "Zuul (22348)"
Branch: master

commit 24538768a6ff007ca37a0be2fbddb3086eb01694
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:20:28 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: I60679f9e78e91bce1145d899332e871dd62d3a9c

Changed in zaqar:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.opendev.org/c/openstack/keystone/+/801083
Committed: https://opendev.org/openstack/keystone/commit/d3044ad238e381c6a7346990354e76d1a8fed741
Submitter: "Zuul (22348)"
Branch: master

commit d3044ad238e381c6a7346990354e76d1a8fed741
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:42:02 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: I12b570cd6d6abda17a68aac6a35ae8193d9c22b4

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/taskflow 4.6.2

This issue was fixed in the openstack/taskflow 4.6.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 28.1.0

This issue was fixed in the openstack/tempest 28.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.opendev.org/c/openstack/tacker/+/801760
Committed: https://opendev.org/openstack/tacker/commit/ea1bc9bda66bbe4046ef5d2219286f9cb919d567
Submitter: "Zuul (22348)"
Branch: master

commit ea1bc9bda66bbe4046ef5d2219286f9cb919d567
Author: Takashi Kajinami <email address hidden>
Date: Thu Jul 22 19:33:46 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: Iafc013cb9b454bc5251d126643f68f3112dafa54

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/zaqar 13.0.0.0rc1

This issue was fixed in the openstack/zaqar 13.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.0.0.0rc1

This issue was fixed in the openstack/neutron 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 6.0.0.0rc1

This issue was fixed in the openstack/tacker 6.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 20.0.0.0rc1

This issue was fixed in the openstack/keystone 20.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 13.0.0.0rc1

This issue was fixed in the openstack/manila 13.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-heatclient 2.5.0

This issue was fixed in the openstack/python-heatclient 2.5.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.opendev.org/c/openstack/mistral/+/801078
Committed: https://opendev.org/openstack/mistral/commit/20aa42b75be349e9d8097b598253d74fedf11619
Submitter: "Zuul (22348)"
Branch: master

commit 20aa42b75be349e9d8097b598253d74fedf11619
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 00:13:10 2021 +0900

    Replace deprecated import of ABCs from collections

    ABCs in collections should be imported from collections.abc and direct
    import from collections is deprecated since Python 3.3.

    Closes-Bug: #1936667
    Change-Id: Ide8aa0323d9713c1c2ea0abf3b671ca4dab95ef0

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 14.0.0.0rc1

This issue was fixed in the openstack/mistral 14.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.