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 — Pyrepl (on Windows) crashes when running a script under hyperfine · Issue #133430 · python/cpython

Pyrepl (on Windows) crashes when running a script under hyperfine #133430

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Pyrepl (on Windows) crashes when running a script under hyperfine#133430
Copy link
Labels
OS-windowstopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@pfmoore
pfmoore
opened on May 5, 2025
Issue body actions

Bug report

Bug description:

Create a simple program, something like test.py:

print("hello")

Run this under hyperfine, as hyperfine python test.py. This fails with an error (non-zero exit code 1)

Running with --show-output gives the traceback

Python 3.13.2 (tags/v3.13.2:4f8bb39, Feb  4 2025, 15:23:48) [MSC v.1942 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\__main__.py", line 6, in <module>
    __pyrepl_interactive_console()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\main.py", line 59, in interactive_console
    run_multiline_interactive_console(console)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\simple_interact.py", line 143, in run_multiline_interactive_console
    statement = multiline_input(more_lines, ps1, ps2)
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\readline.py", line 389, in multiline_input
    return reader.readline()
           ~~~~~~~~~~~~~~~^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\reader.py", line 802, in readline
    self.handle1()
    ~~~~~~~~~~~~^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\reader.py", line 758, in handle1
    event = self.console.get_event(block=False)
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\windows_console.py", line 397, in get_event
    rec = self._read_input(block)
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python313\Lib\_pyrepl\windows_console.py", line 378, in _read_input
    raise WinError(GetLastError())
OSError: [WinError 0] The operation completed successfully.

As far as I can tell, pyrepl seems to be detecting standard input as a console, when it's not (the hyperfine help text says that the default is to take input from "/dev/null" - presumably the null device on Windows.

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Activity

  1. pfmoore
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 5, 2025
  2. hugovk
    added
    OS-windows
    topic-replRelated to the interactive shellRelated to the interactive shell
    on May 5, 2025
  3. pfmoore commented on May 5, 2025

    @pfmoore
    pfmoore
    on May 5, 2025
    MemberAuthor
    More actions

    Never mind - user error. I forgot to quote the command argument to hyperfine - hyperfine py test.py when I should have used hyperfine "py test.py".

    Apologies for the dumb mistake.

    Reacted by Hugo van Kemenade
  4. pfmoore
    closed this as completedon May 5, 2025
  5. hugovk
    closed this as not plannedon May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowstopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      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.