Skip to content

os.system() doesn't support surrogates nor bytes #52659

Closed

Description

@vstinner
BPO 8412
Nosy @vstinner
Files
  • os_system_surrogates.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 2010-04-16.12:48:34.445>
    created_at = <Date 2010-04-16.01:10:20.582>
    labels = ['library', 'expert-unicode']
    title = "os.system() doesn't support surrogates nor bytes"
    updated_at = <Date 2010-04-16.12:48:34.444>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2010-04-16.12:48:34.444>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-04-16.12:48:34.445>
    closer = 'vstinner'
    components = ['Library (Lib)', 'Unicode']
    creation = <Date 2010-04-16.01:10:20.582>
    creator = 'vstinner'
    dependencies = []
    files = ['16941']
    hgrepos = []
    issue_num = 8412
    keywords = ['patch']
    message_count = 4.0
    messages = ['103280', '103281', '103314', '103318']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue8412'
    versions = ['Python 3.1', 'Python 3.2']

    Activity

    1. vstinner commented on Apr 16, 2010

      @vstinner
      MemberAuthor

      os.system() doesn't support bytes, bytearray not str containing surrogates.

      Attached patch uses PyUnicode_FSConverter, bytes2str and release_bytes in (the non-Windows version of) os.system() to support all of this. It locks the buffer because os.system() releases the GIL when calling system().

    2. vstinner commented on Apr 16, 2010

      @vstinner
      MemberAuthor

      See also bpo-8391 (os.execvpe env) and bpo-8393 (subprocess cwd).

    3. vstinner commented on Apr 16, 2010

      @vstinner
      MemberAuthor

      Commited to py3k as r80105. Let see if buildbots are happy or not :-)

    4. vstinner commented on Apr 16, 2010

      @vstinner
      MemberAuthor

      Commited to py3k as r80105

      The buildbots look happy: backported to 3.1 as r80110.

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

      stdlibStandard Library Python modules in the Lib/ directorytopic-unicode

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions