Skip to content

Refuses to scan executable python scripts that don't end in .py #104

Open

Description

@dragonpaw

Description of the bug

In the code there's an automatic error if if not path.endswith(".py") but python executables usually lack the file extension.

What you expected to happen

Scan the python file.

How to reproduce (as minimally and precisely as possible)

Make a python file with a #! line, but no .py in the filename.

Anthing else we need to know?

As an example, we're trying to use interrogate with a project that has a couple of python scripts within the repo in a bin directory, and none of them end in .py.

❯ interrogate bin/postgres-ready
E: Invalid file '[...]/bin/postgres-ready'. Unable interrogate non-Python files.

❯ identify-cli bin/postgres-ready  # from pre-commit
["executable", "file", "python", "text"]

❯ file bin/postgres-ready
bin/postgres-ready: Python script text executable, ASCII text

❯ head -1 bin/postgres-ready
#!/usr/bin/env python

Activity

  1. added
    bug
    needs triage
    on Mar 13, 2022
  2. added
    help wanted
    good first issue
    and removed
    needs triage
    on Apr 7, 2024
  3. added a commit that references this issue on Aug 14, 2026
    c3e4998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issuehelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions