Skip to content

update subprocess docs to reference io.TextIOWrapper #59766

Closed

Description

@cjerdonek
BPO 15561
Nosy @pitrou, @vstinner, @benjaminp, @asvetlov, @cjerdonek, @hynek
Dependencies
  • bpo-15638: incorrect version info for TextIOWrapper write_through docs
  • Files
  • issue-subprocess-docs-1.patch
  • issue-15561-2-branch-32.patch
  • issue-15561-2-branch-default.patch
  • issue-15561-3-branch-32.patch
  • issue-15561-3-branch-default-delta.patch
  • 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 2012-08-13.19:16:02.644>
    created_at = <Date 2012-08-05.19:51:57.300>
    labels = ['easy', 'docs']
    title = 'update subprocess docs to reference io.TextIOWrapper'
    updated_at = <Date 2012-08-13.19:19:58.943>
    user = 'https://github.com/cjerdonek'

    bugs.python.org fields:

    activity = <Date 2012-08-13.19:19:58.943>
    actor = 'chris.jerdonek'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2012-08-13.19:16:02.644>
    closer = 'asvetlov'
    components = ['Documentation']
    creation = <Date 2012-08-05.19:51:57.300>
    creator = 'chris.jerdonek'
    dependencies = ['15638']
    files = ['26703', '26747', '26748', '26783', '26784']
    hgrepos = []
    issue_num = 15561
    keywords = ['patch', 'easy']
    message_count = 17.0
    messages = ['167512', '167584', '167658', '167790', '167791', '167823', '167976', '167992', '168081', '168085', '168094', '168106', '168119', '168121', '168134', '168135', '168136']
    nosy_count = 9.0
    nosy_names = ['pitrou', 'vstinner', 'benjamin.peterson', 'stutzbach', 'asvetlov', 'chris.jerdonek', 'docs@python', 'python-dev', 'hynek']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue15561'
    versions = ['Python 3.2', 'Python 3.3']

    Activity

    1. cjerdonek commented on Aug 5, 2012

      @cjerdonek
      MemberAuthor

      This is an issue to update the subprocess module documentation after updates to io.TextIOWrapper's documentation here:

      http://hg.python.org/cpython/rev/f17a1410ebe5

      This issue was discussed briefly on python-dev:

      http://mail.python.org/pipermail/python-dev/2012-August/121239.html

      Patch attached.

    2. cjerdonek commented on Aug 6, 2012

      @cjerdonek
      MemberAuthor

      Victor, would you be able to take a look at this minor documentation patch? It incorporates the change that you suggested we make on python-dev.

    3. cjerdonek commented on Aug 8, 2012

      @cjerdonek
      MemberAuthor

      io module experts: Can one of you review this minor change to the subprocess documentation to make it reference the newly added io.TextIOWrapper documentation changes?

      For background purposes, digging back, it looks like the original change to subprocess was made here: 9ce8fa0a0899

    4. cjerdonek commented on Aug 9, 2012

      @cjerdonek
      MemberAuthor

      In the process of working on bpo-15595, I noticed that the documentation change will need to be slightly different for Python 3.2 than for 3.3. In 3.2, it is locale.getpreferredencoding() (which defaults to do_setlocale=True) instead of locale.getpreferredencoding(False).

      I will provide a patch adjusted for 3.2.

    5. asvetlov commented on Aug 9, 2012

      @asvetlov
      Contributor

      Please do.

    6. cjerdonek commented on Aug 9, 2012

      @cjerdonek
      MemberAuthor

      I have uploaded updated patches for both 3.2 and the default branch. Thanks, Andrew.

    7. asvetlov commented on Aug 11, 2012

      @asvetlov
      Contributor

      Hmm. As I can see in subprocess.py TextIOWrapper is applied to stdin also in non-buffered (write_through=True) mode. So input will be converted to use '\n' as well.

      Can you reflect this fact in your patches?

    8. cjerdonek commented on Aug 11, 2012

      @cjerdonek
      MemberAuthor

      Can you reflect this fact in your patches?

      Sure. (Though for stdin '\n' is converted to os.linesep and no more.)

      Would you mind if I also updated the following part of the subprocess documentation to reference the part we are updating, so that the documentation is just in one place?

      "If universal_newlines is True, the file objects stdout and stderr are opened as text files, but lines may be terminated by any of '\n', the Unix end-of-line convention, '\r', the old Macintosh convention or '\r\n', the Windows convention. All of these external representations are seen as '\n' by the Python program."

      The part we're updating is in the "Frequently Used Arguments" section and so seems like the natural place for expanded details.

    9. asvetlov commented on Aug 13, 2012

      @asvetlov
      Contributor

      Do you mean to mention stdin as well as stdout/stderr? It will be nice.

    10. cjerdonek commented on Aug 13, 2012

      @cjerdonek
      MemberAuthor

      Yes, that too. :) I am working on it.

    11. cjerdonek commented on Aug 13, 2012

      @cjerdonek
      MemberAuthor

      For 3.2 to mention write_through, bpo-15638 should probably be fixed first. I can create a patch for that first.

    12. cjerdonek commented on Aug 13, 2012

      @cjerdonek
      MemberAuthor

      As I can see in subprocess.py TextIOWrapper is applied to stdin also in non-buffered (write_through=True) mode.

      In 3.2, I will not mention the write_through argument based on Antoine's response to bpo-15638.

    13. cjerdonek commented on Aug 13, 2012

      @cjerdonek
      MemberAuthor

      Andrew, here is the new patch for 3.2. 3.3 will come shortly after.

    14. cjerdonek commented on Aug 13, 2012

      @cjerdonek
      MemberAuthor

      Here is the patch for the default/3.3 branch, which for convenience is a diff for the branch *after the 3.2 patch has been forward-ported to 3.3*.

      I did not think it was necessary to mention write_through specifically since it seems more like an implementation detail (though stdin as a whole is now documented).

    15. python-dev commented on Aug 13, 2012

      python-devmannequin
      Mannequin

      New changeset 381aaf79c254 by Andrew Svetlov in branch '3.2':
      Issue bpo-15561: Update subprocess docs to reference io.TextIOWrapper.
      http://hg.python.org/cpython/rev/381aaf79c254

      New changeset 0cd9423770fa by Andrew Svetlov in branch 'default':
      Issue bpo-15561: Update subprocess docs to reference io.TextIOWrapper.
      http://hg.python.org/cpython/rev/0cd9423770fa

    16. asvetlov commented on Aug 13, 2012

      @asvetlov
      Contributor

      Fixed.
      BTW I prefer to use «stream» as alias to file object it subprocess context. «file» can clash with «the real file in filesystem» for documentation reader.

    17. cjerdonek commented on Aug 13, 2012

      @cjerdonek
      MemberAuthor

      Fixed. BTW I prefer to use «stream» as alias to file object

      Thanks a lot, Andrew. Yes, I agree and actually contemplated doing that myself.

    18. 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

      docsDocumentation in the Doc direasy

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions