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

The-i flag is mixed with custom REPLs in tests #140438

Closed
Labels
3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixestestsTests in the Lib/test dirtopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@johnslavik

Description

@johnslavik

Bug report

Bug description:

This is an issue for a pre-existing PR#140298.

The problem lies in:

classTestAsyncioREPL(unittest.TestCase):
deftest_multiple_statements_fail_early(self):
user_input="1 / 0; print(f'afterwards: {1+1}')"
p=spawn_repl("-m","asyncio")

(I wrote this 😬)

It resorts tospawn_repl that adds-i on top of-m asyncio:

cmd_line= [stdin_fname,'-I','-i']
cmd_line.extend(args)

Mixing-i with-m asyncio causes the asyncio REPL to launch first, and then a regular Python REPL--right after the former exits.
This is an expected outcome when-i and-m asyncio are mixed.
I didn't intend this result of the current setup--we want-i^<custom repl args> to run a REPL when testing without a PTY.

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixestestsTests in the Lib/test dirtopic-replRelated to the interactive shelltype-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