Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Script containing a "shebang" would not start under Windows #100107

Closed
Labels
3.11only security fixesOS-windowstype-bugAn unexpected behavior, bug, or error
@peter88213

Description

@peter88213

Bug report

This Python scripthello.pyw does not start on my PC when I double click it in Windows Explorer.

#!/usr/bin/env python3from tkinter import messageboxmessagebox.showinfo(message='hello, world')

Instead, a console window pops up and disappears instantly.

Now I modify the shebang as follows:

#!/usr/bin/env pythonfrom tkinter import messageboxmessagebox.showinfo(message='hello, world')

On double-clickinghello.pyw,a console opens, then the message box appears.

Now I remove the shebang:

from tkinter import messageboxmessagebox.showinfo(message='hello, world')

On double-clickinghello.pyw, the message box appears as expected.

This misbehavior was observed with the introduction of Python 3.11. It was not like this until version 3.10.8.

Your environment

  • CPython versions tested on: 3.11.1
  • Operating system and architecture: Windows 10 22H2 x64

I have implemented quite a few open source programs with Python, all of which have a shebang for working across platforms. On my download pages I had to generally discourage the use with Python 3.11.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixesOS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp