pyupio / dparse

A parser for Python dependency files
MIT License
61 stars 23 forks source link

ImportError: cannot import name 'SafeConfigParser' from 'configparser' #51

Closed pawamoy closed 2 years ago

pawamoy commented 3 years ago

Description

The SafeConfigParser class was removed from the configparser module in Python 3.11.

https://docs.python.org/3.11/whatsnew/3.11.html

Removed from the configparser module: the SafeConfigParser class, the filename property of the ParsingError class, the readfp() method of the ConfigParser class, deprecated since Python 3.2. (Contributed by Hugo van Kemenade in bpo-45173.)

What I Did

Traceback (most recent call last):
  File "/media/data/dev/aria2p/__pypackages__/3.11/bin/duty", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/duty-0.7.0-py3-none-any/lib/duty/cli.py", line 284, in main
    duty.run(*posargs, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/duty-0.7.0-py3-none-any/lib/duty/collection.py", line 187, in run
    self(self.context, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/duty-0.7.0-py3-none-any/lib/duty/collection.py", line 164, in __call__
    self.function(context, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/data/dev/aria2p/duties.py", line 163, in check_dependencies
    from safety.formatter import report
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/safety-1.10.3-py2.py3-none-any/lib/safety/formatter.py", line 8, in <module>
    from .util import get_packages_licenses
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/safety-1.10.3-py2.py3-none-any/lib/safety/util.py", line 1, in <module>
    from dparse.parser import setuptools_parse_requirements_backport as _parse_requirements
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/dparse-0.5.1-py3-none-any/lib/dparse/__init__.py", line 9, in <module>
    from .parser import parse  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pawamoy/.cache/pdm/packages/dparse-0.5.1-py3-none-any/lib/dparse/parser.py", line 9, in <module>
    from configparser import SafeConfigParser, NoOptionError
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name 'SafeConfigParser' from 'configparser' (/home/pawamoy/.basher-packages/pyenv/pyenv/versions/3.11-dev/lib/python3.11/configparser.py)