Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make python-m pickletools do something useful #53340

Closed
abalkin opened this issue Jun 27, 2010 · 8 comments
Closed

Make python-m pickletools do something useful #53340

abalkin opened this issue Jun 27, 2010 · 8 comments
Assignees
Labels
easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@abalkin
Copy link
Member

abalkin commented Jun 27, 2010

BPO 9094
Nosy @mdickinson, @abalkin, @pitrou, @avassalotti
Files
  • pickletools.diff
  • issue9094.diff
  • 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/abalkin'
    closed_at = <Date 2010-07-06.18:31:21.228>
    created_at = <Date 2010-06-27.23:12:13.558>
    labels = ['easy', 'type-feature', 'library']
    title = 'Make python-m pickletools do something useful'
    updated_at = <Date 2010-07-06.18:31:21.226>
    user = 'https://github.com/abalkin'

    bugs.python.org fields:

    activity = <Date 2010-07-06.18:31:21.226>
    actor = 'belopolsky'
    assignee = 'belopolsky'
    closed = True
    closed_date = <Date 2010-07-06.18:31:21.228>
    closer = 'belopolsky'
    components = ['Library (Lib)']
    creation = <Date 2010-06-27.23:12:13.558>
    creator = 'belopolsky'
    dependencies = []
    files = ['17783', '17797']
    hgrepos = []
    issue_num = 9094
    keywords = ['patch', 'easy']
    message_count = 8.0
    messages = ['108807', '108858', '108878', '108884', '109189', '109190', '109191', '109415']
    nosy_count = 4.0
    nosy_names = ['mark.dickinson', 'belopolsky', 'pitrou', 'alexandre.vassalotti']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue9094'
    versions = ['Python 3.2']

    @abalkin
    Copy link
    Member Author

    abalkin commented Jun 27, 2010

    Attached patch makes python -m pickletools <picklefile> print symbolic disassembly of a pickle to stdout. If the idea is well received, I will add help option, usage string and possibly -o option to redirect output to a file.

    I am not sure that current "run doctest" behavior is worth preserving given that one can always do python -m doctest Lib/pickletools.py instead.

    @abalkin abalkin self-assigned this Jun 27, 2010
    @abalkin abalkin added stdlib Python modules in the Lib dir easy type-feature A feature request or enhancement labels Jun 27, 2010
    @avassalotti
    Copy link
    Member

    Good idea!

    You can remove the doctest behavior. I don't think it is useful. But if you remove it, make sure you add an usage message when no argument is given.

    @pitrou
    Copy link
    Member

    pitrou commented Jun 28, 2010

    Well, assuming you want to make it useful, I'd make that behaviour depend on a command-line option, such that other actions can be added later.

    @abalkin
    Copy link
    Member Author

    abalkin commented Jun 29, 2010

    Well, assuming you want to make it useful, I'd make that
    behaviour depend on a command-line option, ..

    OK, Antoine, you asked for it. :-)

    bpo-9094.diff

    @abalkin
    Copy link
    Member Author

    abalkin commented Jul 3, 2010

    I would like to commit this. Any objections? Changes only affect running pickletools as __main__. Does this need to be documented in pickletools.rst? I noticed that dis.rst does not describe running dis.py from command line. Similarly, I cannot find tests for any module's command line behavior to base -m pickletools testing on.

    @pitrou
    Copy link
    Member

    pitrou commented Jul 3, 2010

    In 'run self-test suit', I suppose you mean 'suite'.
    Otherwise, looks ok.

    @abalkin
    Copy link
    Member Author

    abalkin commented Jul 3, 2010

    Committed in r82514. I don't think this appropriate for 3.1, but will not block it yet if someone thinks it should be merged.

    @abalkin
    Copy link
    Member Author

    abalkin commented Jul 6, 2010

    On the second thought, this is clearly not a bug fix. Not a backport candidate.

    @abalkin abalkin closed this as completed Jul 6, 2010
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants