GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pylint is broken with CPython main · Issue #101914 · python/cpython

pylint is broken with CPython main #101914

New issue
Copy link
New issue
Copy link
Closed
Closed
pylint is broken with CPython main#101914
Copy link
Assignees
markshannon
Labels
3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@mdboom
mdboom
opened on Feb 14, 2023
Issue body actions

Bug report

pylint currently crashes with CPython main. I noticed this when I noticed the pylint benchmark in Pyston's benchmark suite was no longer working.

The first bad commit is 4a1c58d (@markshannon), issue #96793, PR #98772.

I don't know whether this is the result of expected breakage (and pylint or astroid needs to modify their code) or there is a specialization failure here.

Your environment

Linux

To reproduce

pip install pylint==2.16.2

Download the example Python file from the pyston macrobenchmark suite

pylint dist.py

Backtrace:

Exception on node <Call l.430 at 0x7ff062d76ae0> in file '/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/data/pylint_target/dist.py'
Traceback (most recent call last):
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/inference.py", line 450, in infer_subscript
    assigned = value.getitem(index_value, context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/nodes/node_classes.py", line 2466, in getitem
    raise AstroidIndexError(index)
astroid.exceptions.AstroidIndexError: <exception str() failed>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/pylint/utils/ast_walker.py", line 91, in walk
    callback(astroid)
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/pylint/checkers/base/basic_checker.py", line 705, in visit_call
    if utils.is_terminating_func(node):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/pylint/checkers/utils.py", line 2181, in is_terminating_func
    return True
           ^^^^
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
    yield from self._infer(context=context, **kwargs)
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/decorators.py", line 119, in wrapped
    yielded.add(ares)
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/inference.py", line 380, in infer_attribute
    context.boundnode = old_boundnode
    ^^^^^^^^^^^^^^^^^
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
    for i, result in enumerate(self._infer(context=context, **kwargs)):
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield next(generator)
          ^^^^^^^^^^^^^^^
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/decorators.py", line 119, in wrapped
    yielded.add(ares)
  File "/home/mdboom/Work/builds/python-macrobenchmarks/benchmarks/bm_pylint/venv/lib/python3.12/site-packages/astroid/inference.py", line 458, in infer_subscript
    raise InferenceError(node=self, context=context) from exc
astroid.exceptions.InferenceError: Inference failed for <Subscript l.430 at 0x7ff062d76b40>.
************* Module pylint_target.dist
data/pylint_target/dist.py:1:0: C0302: Too many lines in module (1261/1000) (too-many-lines)
data/pylint_target/dist.py:22:0: E0401: Unable to import 'distutils.errors' (import-error)
data/pylint_target/dist.py:22:0: W4901: Deprecated module 'distutils.errors' (deprecated-module)
data/pylint_target/dist.py:22:0: W0401: Wildcard import distutils.errors (wildcard-import)
data/pylint_target/dist.py:23:0: E0401: Unable to import 'distutils.fancy_getopt' (import-error)
data/pylint_target/dist.py:23:0: W4901: Deprecated module 'distutils.fancy_getopt' (deprecated-module)
data/pylint_target/dist.py:24:0: E0401: Unable to import 'distutils.util' (import-error)
data/pylint_target/dist.py:24:0: W4901: Deprecated module 'distutils.util' (deprecated-module)
data/pylint_target/dist.py:25:0: E0401: Unable to import 'distutils' (import-error)
data/pylint_target/dist.py:25:0: W4901: Deprecated module 'distutils' (deprecated-module)
data/pylint_target/dist.py:26:0: E0401: Unable to import 'distutils.debug' (import-error)
data/pylint_target/dist.py:26:0: W4901: Deprecated module 'distutils.debug' (deprecated-module)
data/pylint_target/dist.py:49:0: R0902: Too many instance attributes (27/7) (too-many-instance-attributes)
data/pylint_target/dist.py:278:26: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
data/pylint_target/dist.py:141:4: R0912: Too many branches (18/12) (too-many-branches)
data/pylint_target/dist.py:141:4: R0915: Too many statements (60/50) (too-many-statements)
data/pylint_target/dist.py:305:8: W0622: Redefining built-in 'dict' (redefined-builtin)
data/pylint_target/dist.py:310:4: C0116: Missing function or method docstring (missing-function-docstring)
data/pylint_target/dist.py:311:8: C0415: Import outside toplevel (pprint.pformat) (import-outside-toplevel)
data/pylint_target/dist.py:328:30: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
data/pylint_target/dist.py:331:30: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
data/pylint_target/dist.py:382:26: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
data/pylint_target/dist.py:386:4: C0116: Missing function or method docstring (missing-function-docstring)
data/pylint_target/dist.py:387:8: C0415: Import outside toplevel (configparser.ConfigParser) (import-outside-toplevel)
data/pylint_target/dist.py:410:30: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
data/pylint_target/dist.py:424:12: C2801: Unnecessarily calls dunder method __init__. Instantiate class directly. (unnecessary-dunder-call)
data/pylint_target/dist.py:1:0: F0002: data/pylint_target/dist.py: Fatal error while checking 'data/pylint_target/dist.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/mdboom/.cache/pylint/pylint-crash-2023-02-14-15-25-33.txt'. (astroid-error)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Activity

  1. mdboom
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Feb 14, 2023
  2. markshannon
    self-assigned this
    on Feb 15, 2023
  3. Eclips4 commented on Feb 17, 2023

    @Eclips4
    Eclips4
    on Feb 17, 2023
    Member
    More actions

    More simple way to reproduce it:

    a = b()
    func(1)

    Backtrace:

    ************* Module test
    test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
    test.py:1:4: E0602: Undefined variable 'b' (undefined-variable)
    Exception on node <Call l.2 at 0x7f4912053dd0> in file '/home/eclips4/projects/test.py'
    Traceback (most recent call last):
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/pylint/utils/ast_walker.py", line 91, in walk
        callback(astroid)
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/pylint/checkers/base/basic_checker.py", line 705, in visit_call
        if utils.is_terminating_func(node):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/pylint/checkers/utils.py", line 2181, in is_terminating_func
        return True
               ^^^^
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
        yield from self._infer(context=context, **kwargs)
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
        yield next(generator)
              ^^^^^^^^^^^^^^^
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/astroid/decorators.py", line 111, in wrapped
        for res in _func(node, context, **kwargs):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/eclips4/projects/venv_3_12/lib/python3.12/site-packages/astroid/inference.py", line 240, in infer_name
        raise NameInferenceError(
    astroid.exceptions.NameInferenceError: 'func' not found in <Module.test l.0 at 0x7f49126cdd30>.
    test.py:1:0: F0002: test.py: Fatal error while checking 'test.py'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/eclips4/.cache/pylint/pylint-crash-2023-02-17-20-32-34.txt'. (astroid-error)
    
    ------------------------------------------------------------------
    Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)
    Reacted by Michael Droettboom
  4. iritkatriel
    added
    release-blocker
    3.12only security fixesonly security fixes
    on Apr 4, 2023
  5. ezio-melotti
    added this to Release and Deferred blockers 🚫on Apr 4, 2023
  6. github-project-automation
    moved this to Todo in Release and Deferred blockers 🚫on Apr 4, 2023
  7. mdboom commented on Apr 20, 2023

    @mdboom
    mdboom
    on Apr 20, 2023
    ContributorAuthor
    More actions

    Fixed by #103502.

  8. mdboom
    closed this as completedon Apr 20, 2023
  9. github-project-automation
    moved this from Todo to Done in Release and Deferred blockers 🚫on Apr 20, 2023
  10. hauntsaninja commented on Apr 20, 2023

    @hauntsaninja
    hauntsaninja
    on Apr 20, 2023
    Contributor
    More actions

    Would be nice if there's a relatively small regression test we could add!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @markshannon
    markshannon

Labels

3.12only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

  • Release and Deferred blockers 🚫
    Status
    Done
    Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.