Skip to content

use bytes for code objects #45363

Closed
Closed

Description

@nnorwitz
mannequin
BPO 1022
Nosy @gvanrossum, @brettcannon
Files
  • code-bytes.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 = 'https://github.com/gvanrossum'
    closed_at = <Date 2007-10-24.20:02:52.703>
    created_at = <Date 2007-08-25.17:47:08.019>
    labels = ['interpreter-core']
    title = 'use bytes for code objects'
    updated_at = <Date 2007-10-24.20:02:52.702>
    user = 'https://bugs.python.org/nnorwitz'

    bugs.python.org fields:

    activity = <Date 2007-10-24.20:02:52.702>
    actor = 'gvanrossum'
    assignee = 'gvanrossum'
    closed = True
    closed_date = <Date 2007-10-24.20:02:52.703>
    closer = 'gvanrossum'
    components = ['Interpreter Core']
    creation = <Date 2007-08-25.17:47:08.019>
    creator = 'nnorwitz'
    dependencies = []
    files = ['8317']
    hgrepos = []
    issue_num = 1022
    keywords = ['patch']
    message_count = 4.0
    messages = ['55290', '55436', '55597', '56727']
    nosy_count = 3.0
    nosy_names = ['gvanrossum', 'nnorwitz', 'brett.cannon']
    pr_nums = []
    priority = 'low'
    resolution = 'rejected'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1022'
    versions = ['Python 3.0']

    Activity

    1. nnorwitz commented on Aug 25, 2007

      nnorwitzmannequin
      MannequinAuthor

      This patch has a hack to read in marshaled code objects. Bytes can't be
      marshaled currently (they are stored as strings). So when reading a
      marshaled code object, the hack converts them to bytes.

      All tests except test_modulefinder pass.

      The issue is that since bytes are mutable, they aren't suitable for code
      objects since a user could change them at any time.

    2. gvanrossum commented on Aug 29, 2007

      @gvanrossum
      Member

      I'll defer thinking about this until post-a1.

    3. brettcannon commented on Sep 3, 2007

      @brettcannon
      Member

      I have security/stability issues with code objects having mutable
      bytecode. This would allow someone to possibly crash the interpreter
      with crappy bytecode. I also have a worry that someone might come up
      with some clever way of causing different code to execute through
      manipulating what LOAD_GLOBALS or STORE_GLOBALS accesses/sets.

    4. gvanrossum commented on Oct 24, 2007

      @gvanrossum
      Member

      We won't be doing it this way.

    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

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions