I came across this issue in httpie and started my investigation.
The problem is while pretty printing the json, output is alpha sorted because keys are hashed and user wanted to preserve the order. Then I made 3 comments to the issue. First comment was half correct and explained why it isn’t possible to get the desired output, quickly I figured my assumptions were wrong and second comment explained what is actually happening, finally I proposed the solution. Since I made wrong assumptions and to make further debugging easy, I want to find easiest way to trace all functions/methods invocations.
#! -*- coding: utf-8 -*- from httpie.core import main #import pdb import sys #import os #import trace #pdb.set_trace() main(args=sys.argv[1:])
I debugged with pdb for half an hour pressing
s key and fed up. The pdb was beautiful like her, I was enjoying each line it was printing, it was like watching her speak and I was mesemerized. After half an hour I gave up and went back to trace command. Finally I figured out I can use
--ignore-module from command line.
After one hour of spending time, final command looked like(scroll completely)
The essay is 1269 characters to terminal and the result of it is pull request.
- Parameterize Python Tests
- “Don’t touch your face” - Neural Network will warn you
- Capture all browser HTTP[s] calls to load a web page
- How long do Python Postgres tools take to load data?
- Debugging Python multiprocessing program with strace
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.