osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why the CLI hang using pyjwt ?


Not sure why the CLI command "pyjwt decode --no-verify ..." will hang at sys.stdin.read() even though I provided all the input.  Any ideas on how to work around the problem? 

$ pyjwt -v
pyjwt 1.5.3

$ pyjwt decode --no-verify eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
^CTraceback (most recent call last):
File "/usr/local/bin/pyjwt", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/jwt/main.py", line 157, in main
output = arguments.func(arguments)
File "/usr/local/lib/python2.7/dist-packages/jwt/main.py", line 58, in decode_payload
token = sys.stdin.read()

$ pyjwt decode --no-verify eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg
^CTraceback (most recent call last):
File "/Users/v612996/anaconda/bin/pyjwt", line 11, in
sys.exit(main())
File "/Users/v612996/anaconda/lib/python3.6/site-packages/jwt/main.py", line 157, in main
output = arguments.func(arguments)
File "/Users/v612996/anaconda/lib/python3.6/site-packages/jwt/main.py", line 58, in decode_payload
token = sys.stdin.read()
KeyboardInterrupt
$ python --version
Python 3.6.0 :: Anaconda custom (x86_64)

But the same token decoded perfectly under python 2.6 interpreter:

            jwt.decode(encoded,verify=False)
            {u'some': u'payload'}

What is the work around of "pyjwt decode --no-verify" hang in the CLI?