Skip to content

False negative for bad-thread-instantiation #7570

Closed
@clavedeluna

Description

@clavedeluna

Bug description

# module test.py

import threading


def thread_target(n):
    print(n ** 2)


thread = threading.Thread(thread_target, args=(10,))
thread.start()

I actually saw this example in pylint-errors and expected it to work.

Configuration

None

Command used

pylint test.py

Pylint output

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

Expected behavior

test.py:8:9: W1506: threading.Thread needs the target function (bad-thread-instantiation)

Pylint version

pylint 2.16.0-dev
astroid 2.12.10
Python 3.8.9 (default, Apr 13 2022, 08:48:07)

OS / Environment

Mac

Additional dependencies

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationinference

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions