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 — Popen() object stdout attribute reassignment behaviour · Issue #47937 · python/cpython

Popen() object stdout attribute reassignment behaviour #47937

New issue
Copy link
New issue
Copy link
Closed
Closed
Popen() object stdout attribute reassignment behaviour#47937
Copy link
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

vincentlegoll
mannequin
opened on Aug 26, 2008
Issue body actions
BPO 3687
Nosy @birkenfeld, @terryjreedy, @giampaolo, @maaz92, @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 = None
created_at = <Date 2008-08-26.15:57:45.065>
labels = ['3.11', 'type-bug', '3.9', '3.10', 'docs']
title = 'Popen() object stdout attribute reassignment behaviour'
updated_at = <Date 2021-12-05.15:57:52.556>
user = 'https://bugs.python.org/vincentlegoll'

bugs.python.org fields:

activity = <Date 2021-12-05.15:57:52.556>
actor = 'iritkatriel'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2008-08-26.15:57:45.065>
creator = 'vincent.legoll'
dependencies = []
files = []
hgrepos = []
issue_num = 3687
keywords = []
message_count = 5.0
messages = ['71983', '107970', '107976', '281545', '407713']
nosy_count = 7.0
nosy_names = ['georg.brandl', 'terry.reedy', 'giampaolo.rodola', 'vlegoll', 'vincent.legoll', 'maaz92', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3687'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

Linked PRs

  • gh-47937: Note that Popen attributes are read-only #93070
  • [3.10] gh-47937: Note that Popen attributes are read-only (GH-93070) #101683
  • [3.11] gh-47937: Note that Popen attributes are read-only (GH-93070) #101684

Activity

  1. vincentlegoll commented on Aug 26, 2008

    @vincentlegoll
    vincentlegollmannequin
    on Aug 26, 2008
    MannequinAuthor
    More actions

    The subprocess.Popen() object documentation should indicate
    that the stdout attribute should not be modified after
    object construction. Because that won't work.

    Or the attribute may be rendered read-only

    >> from subprocess import Popen, PIPE
    >> import sys, os
    >> p1 = Popen(["echo", "1"], stdout = PIPE)
    >> p2 = Popen(["cat"], stdin = p1.stdout, stderr = PIPE, stdout = PIPE)
    >> p2.stdout = sys.stdout
    >> print p2.communicate()

    This blocks forever

  2. vincentlegoll
    assigned
    birkenfeld
    on Aug 26, 2008
  3. vincentlegoll
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Aug 26, 2008
  4. terryjreedy commented on Jun 17, 2010

    @terryjreedy
    terryjreedy
    on Jun 17, 2010
    Member
    More actions

    While it could be argued that it is 'obvious' that changing the stdin, stdout, stderr, and pid of a processes cannot work, I agree that a small addition would be good. In 17.1.2. Popen Objects, after "The following attributes are also available", insert " (do not try to change them)" before ':'.

    Actually, it seems to me that the attributes should actually be read-only (in 3.2) if possible (via custom Popen.__setattr__), in which case the only doc change needed (for 3.2) would be insertion of 'read-only' before 'attributes'.

    Georg, if you know the id of the subprocess maintainer (if there is one now), could you add him to the nosy list for an opinion or comment?

  5. vlegoll commented on Jun 17, 2010

    @vlegoll
    vlegollmannequin
    on Jun 17, 2010
    Mannequin
    More actions

    On Thu, Jun 17, 2010 at 2:34 AM, Terry J. Reedy <[email protected]> wrote:

    While it could be argued that it is 'obvious'

    What is obvious for someone maybe is not for others, if I tried to modify it,
    that was on the (false) assumption that it will do what I wanted (whatever
    that is)...

    Adding more precision to documentation or making the interface fool proof
    will make life of dumb devs like me easier by not having to guess or try.

    Thanks for taking care of this.

  6. admin
    assigned
    docspython
    and unassigned
    birkenfeld
    on Oct 29, 2010
  7. maaz92 commented on Nov 23, 2016

    @maaz92
    maaz92mannequin
    on Nov 23, 2016
    Mannequin
    More actions

    Hi, I want to update the doc for this. This will be my first attempt to update the documentation.

  8. vadmium
    added
    3.7 (EOL)end of lifeend of life
    on Dec 6, 2016
  9. iritkatriel commented on Dec 5, 2021

    @iritkatriel
    iritkatriel
    on Dec 5, 2021
    Member
    More actions

    The situation is the same in 3.11, both doc and implementation.

  10. iritkatriel
    added
    3.9 (EOL)end of lifeend of life
    3.10 (EOL)end of lifeend of life
    3.11only security fixesonly security fixes
    and removed
    3.7 (EOL)end of lifeend of life
    on Dec 5, 2021
  11. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  12. iritkatriel
    added
    3.12only security fixesonly security fixes
    and removed
    3.9 (EOL)end of lifeend of life
    on Feb 2, 2023
  13. gpshead
    added a commit that references this issue on Feb 8, 2023

    gh-47937: Note that Popen attributes are read-only (#93070)

    027adf4
  14. miss-islington
    added 3 commits that reference this issue on Feb 8, 2023

    pythongh-47937: Note that Popen attributes are read-only (pythonGH-93070

    49398b8

    pythongh-47937: Note that Popen attributes are read-only (pythonGH-93070

    cc9e77c

    pythongh-47937: Note that Popen attributes are read-only (pythonGH-93070

    15e6490
  15. gpshead
    closed this as completedon Feb 8, 2023
  16. ambv
    added 2 commits that reference this issue on Feb 8, 2023

    [3.11] gh-47937: Note that Popen attributes are read-only (GH-93070) (#…

    7240ba7

    [3.10] gh-47937: Note that Popen attributes are read-only (GH-93070) (#…

    8bc4111
  17. carljm
    added a commit that references this issue on Feb 9, 2023

    Merge branch 'main' into inlinecomp2

    be3becc
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

    3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.12only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtype-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.