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 — marshal module is imcomplete · Issue #3458 · RustPython/RustPython

marshal module is imcomplete #3458

New issue
Copy link
New issue
Copy link
Closed
Closed
marshal module is imcomplete#3458
Copy link
Labels
A-stdlibC-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython

Description

@youknowone
youknowone
opened on Nov 26, 2021
Issue body actions

Feature

marshal dumps and loads are incomplete

Python Documentation

https://docs.python.org/3/library/marshal.html

Reacted by Snowapril, dswij, Leonardo Freua and Lee Dogeon

Activity

  1. youknowone
    added
    good first issueGood for newcomersGood for newcomers
    on Nov 26, 2021
  2. jakearmendariz commented on Dec 19, 2021

    @jakearmendariz
    jakearmendariz
    on Dec 19, 2021
    Contributor
    More actions

    Hi, I was looking at this issue (new to this project) and I am struggling a bit.

    I assume the primary changes would be made to the marshal.rs file. My first thought is that we would add more cases the loads and dumps match statements to handle PyStr, PyInt, PyFloat etc. However, the loads function expects the returning of a PyCode object, thus at some point a PyCode object would have to be created (either in loads after reading the raw bytes, or in dumps by converting all PyObjectRef into PyCode first.

    Am I understanding this correctly? If so, how can we convert and the ConstantData/PyObjectRef/bytes into a PyCode or CodeObject?

    FYI I am able to get any constant to a PyConstant without much trouble, it's the CodeObject creation that seems necessary and is confusing.

    Thanks for any advice or tips you can give. I'm somewhat new to rust and interpreters and appreciate all the help I can get!

  3. youknowone commented on Dec 19, 2021

    @youknowone
    youknowone
    on Dec 19, 2021
    MemberAuthor
    More actions

    Your approach is correct. The return type can be changed to PyObjectRef to include any type of python object. The most common way to convert PyCode or other types into PyObjectRef is using into_pyobject. The other way - PyObjectRef to each type - will be try_into_value.

  4. djrmarques commented on Apr 25, 2022

    @djrmarques
    djrmarques
    on Apr 25, 2022
    Contributor
    More actions

    Hello, is this issue closed already?

  5. youknowone commented on Apr 25, 2022

    @youknowone
    youknowone
    on Apr 25, 2022
    MemberAuthor
    More actions

    Oh, yep. test_marshal.py is done. So this is also done. Thank you for remind it.

  6. youknowone
    closed this as completedon Apr 25, 2022
  7. youknowone
    removed
    good first issueGood for newcomersGood for newcomers
    on May 3, 2022
  8. youknowone commented on May 3, 2022

    @youknowone
    youknowone
    on May 3, 2022
    MemberAuthor
    More actions

    #3681
    @djrmarques good news, marshal is not completed yet

    Reacted by djrmarques
  9. youknowone
    reopened this on May 3, 2022
  10. youknowone
    added
    C-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython
    A-stdlib
    on May 8, 2022
  11. youknowone commented on Oct 6, 2026

    @youknowone
    youknowone
    on Oct 6, 2026
    MemberAuthor
    More actions

    marshal.dumps / marshal.loads round-trip None, bool, int, float, str, bytes, tuple, list, dict, set, and code objects, with marshal.version exposed. Lib/test/test_marshal.py has a single leftover expectedFailure about set repr order under PYTHONHASHSEED, which is not missing marshal support.

    Closing.

    — commented by Grok 4.6

  12. youknowone
    closed this as completedon Oct 6, 2026
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

    A-stdlibC-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython

    Type

    No type

    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.