Skip to content

The order of interactive prompt and traceback on Windows #63038

Description

@Drekin
mannequin
BPO 18838
Nosy @bitdancer, @iritkatriel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-11-19.18:17:25.854>
created_at = <Date 2013-08-26.09:05:07.892>
labels = ['type-bug', 'OS-windows']
title = 'The order of interactive prompt and traceback on Windows'
updated_at = <Date 2020-11-19.18:17:25.853>
user = 'https://bugs.python.org/Drekin'

bugs.python.org fields:

activity = <Date 2020-11-19.18:17:25.853>
actor = 'iritkatriel'
assignee = 'none'
closed = True
closed_date = <Date 2020-11-19.18:17:25.854>
closer = 'iritkatriel'
components = ['Windows']
creation = <Date 2013-08-26.09:05:07.892>
creator = 'Drekin'
dependencies = []
files = []
hgrepos = []
issue_num = 18838
keywords = []
message_count = 7.0
messages = ['196192', '196216', '247461', '381048', '381170', '381449', '381450']
nosy_count = 3.0
nosy_names = ['r.david.murray', 'Drekin', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue18838'
versions = ['Python 3.3']

Activity

  1. Drekin commented on Aug 26, 2013

    Drekinmannequin
    MannequinAuthor

    On Windows, Python 3.3.2, when I run Python as a subprocess via Popen("py -i somescript.py", stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate() and somescript.py ends with exception, there is first interactive promt ">>>" in stderr output and then the traceback which is reversed to standard order when somescript.py is run interactively directly.

    Corresponding StackOverflow question: http://stackoverflow.com/questions/18419724/position-of-prompt-in-stderr-after-systemexit .

  2. bitdancer commented on Aug 26, 2013

    @bitdancer
    Member

    For anyone who wants to look in to this: according to the stack overflow question and comments, this is a behavior change between python2 and python3.

  3. Drekin commented on Jul 27, 2015

    Drekinmannequin
    MannequinAuthor

    Yes, it is a behavior change between Python 2 and Python 3. I just tried with 2.7 and 3.0.

  4. iritkatriel commented on Nov 16, 2020

    @iritkatriel
    Member

    On version 3.10, windows 10 I don't see this - the prompt comes after the traceback.

    Adam, are you seeing this issue on any python version >= 3.8?

  5. Drekin commented on Nov 16, 2020

    Drekinmannequin
    MannequinAuthor

    So far I could reproduce the issue on Python 3.7, Windows Vista 64bit. I'll try with newer versions.

    The output I got:
    >>> from subprocess import *
    >>> Popen("py -i foo.py", stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
    (b'', b'>>> Traceback (most recent call last):\r\n  File "foo.py", line 2, in <module>\r\n    1/0\r\nZeroDivisionError: division by zero\r\n\r\n')
  6. Drekin commented on Nov 19, 2020

    Drekinmannequin
    MannequinAuthor

    The order is fine on Python 3.8, Windows 10.

  7. iritkatriel commented on Nov 19, 2020

    @iritkatriel
    Member

    Thanks. I'm closing this because 3.7 is only getting security fixes now.

  8. transferred this issue fromon Apr 10, 2022
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-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions