Page MenuHomePhabricator

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

Description

Importing pywikibot in Python 3.7 gives the following warning:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from warnings import resetwarnings as rw
>>> rw()
>>> import pywikibot
...pywikibot-core\pywikibot\tools\__init__.py:929: DeprecationWarning: Using or importing the ABCs from 'col
lections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class EmptyDefault(str, collections.Mapping):
...pywikibot-core\pywikibot\tools\__init__.py:987: DeprecationWarning: Using or importing the ABCs from 'col
lections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  class IteratorNextMixin(collections.Iterator):
...Python37\lib\site-packages\pkg_resources\_vendor\pyparsing.py:943: DeprecationWarning: Using or
importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  collections.MutableMapping.register(ParseResults)
...Python37\lib\site-packages\pkg_resources\_vendor\pyparsing.py:3226: DeprecationWarning: Using or
 importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  elif isinstance( exprs, collections.Iterable ):
...Python37\lib\site-packages\setuptools\depends.py:2: DeprecationWarning: the imp module is deprec
ated in favour of importlib; see the module's documentation for alternative uses
  import imp
...pywikibot-core\pywikibot\data\api.py:19: DeprecationWarning: Using or importing the ABCs from 'collection
s' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Container, MutableMapping
WARNING: ...pywikibot-core\pywikibot\diff.py:14: DeprecationWarning: Using or importing the ABCs from 'colle
ctions' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Sequence

>>>

Event Timeline

Dalba renamed this task from Using or importing the ABCs from 'col lections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working to Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working.Jun 28 2018, 11:26 AM

https://docs.python.org/3/library/collections.html#module-collections:

Changed in version 3.3: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.7. Subsequently, they will be removed entirely.

Python 3.8 is scheduled to be released on 2019-10-20 and 2.7 support continues until 2020-01-01.

Change 443034 had a related patch set uploaded (by Dalba; owner: dalba):
[pywikibot/core@master] Try to import abstract base classes from collections.abc

https://gerrit.wikimedia.org/r/443034

Change 443034 merged by jenkins-bot:
[pywikibot/core@master] Try to import abstract base classes from collections.abc

https://gerrit.wikimedia.org/r/443034

Is pyparsing.py a concern?

I filed an issue upstream: https://github.com/pyparsing/pyparsing/issues/12