This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make python-m pickletools do something useful
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: belopolsky Nosy List: alexandre.vassalotti, belopolsky, mark.dickinson, pitrou
Priority: normal Keywords: easy, patch

Created on 2010-06-27 23:12 by belopolsky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pickletools.diff belopolsky, 2010-06-27 23:12
issue9094.diff belopolsky, 2010-06-29 01:01
Messages (8)
msg108807 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-06-27 23:12
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.
msg108858 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2010-06-28 20:28
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.
msg108878 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-06-28 23:14
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.
msg108884 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-06-29 01:01
> 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. :-)

issue9094.diff
msg109189 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-03 19:18
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.
msg109190 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-07-03 20:03
In 'run self-test suit', I suppose you mean 'suite'.
Otherwise, looks ok.
msg109191 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-03 20:38
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.
msg109415 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-06 18:31
On the second thought, this is clearly not a bug fix.  Not a backport candidate.
History
Date User Action Args
2022-04-11 14:57:02adminsetgithub: 53340
2010-07-06 18:31:21belopolskysetstatus: pending -> closed

messages: + msg109415
2010-07-03 20:38:41belopolskysetstatus: open -> pending

messages: + msg109191
stage: patch review -> resolved
2010-07-03 20:03:20pitrousetmessages: + msg109190
2010-07-03 19:18:48belopolskysetnosy: + mark.dickinson
resolution: accepted
messages: + msg109189
2010-06-29 01:01:17belopolskysetfiles: + issue9094.diff

messages: + msg108884
2010-06-28 23:14:21pitrousetnosy: + pitrou
messages: + msg108878
2010-06-28 20:28:08alexandre.vassalottisetmessages: + msg108858
2010-06-27 23:12:13belopolskycreate