Skip to content

Executable scripts with shebang line are not recognised as Python files #134

Description

@dejlek

Description
As the title says. IDE does not treat files with shebang (and no .py extension) the same as "regular" Python files.

Steps to reproduce the behavior:

  1. outside the IDE make a new file in your project named shtool
  2. Add a shebang line and a simple print("hello") line
  3. Save

Expected behavior
IDE should highlight and autocomplete as you edit the file.

Screenshots

Image

Desktop (please complete the following information):

  • OS: Linux/Fedora
  • JDK Version 24
  • Python version 3.11.13
  • Netbeans Version: 27
  • Python Plugin Version: 1.0

Activity

  1. albilu commented on Oct 3, 2025

    @albilu
    Owner

    @dejlek There is a limitation in Netbeans handling file without extensions. Same issue with files like JenkinFile, Dockerfile etc...

    There is a workaround: You can Right click the file and Open As:

    Image

    This will make Netbeans open it as a Python file:

    Image

    The drawback is that from then Netbeans will open all files without extension as Python files.

    You can try the solution proposed in this comment to see if it works better. I didn't try.
    apache/netbeans#6560 (comment)

  2. removed
    bugSomething isn't working
    on Oct 3, 2025
  3. dejlek commented on Oct 3, 2025

    @dejlek
    Author

    OK, then we should close this issue as "won't fix" as it is not a plugin issue....

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions