Bug 1159316

Summary: [abrt] python-libs: tool.py:24:main:IOError: [Errno 2] No such file or directory: 'grep'
Product: [Fedora] Fedora Reporter: Javi Ribera <javiribera>
Component: pythonAssignee: Bohuslav "Slavek" Kabrda <bkabrda>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: bkabrda, dmalcolm, ivazqueznet, jonathansteffan, mehlis, mstuchli, ncoghlan, rkuska, tomspur, tradej
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/9ab891ce310a1741fa75db6d6d1cb80964c1c2b8
Whiteboard: abrt_hash:498ef4d926c3699d414f5057d440d7e7a502b437
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-04 22:47:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Javi Ribera 2014-10-31 13:42:04 UTC
Description of problem:
executing this instruction:
$ curl -s http://httpbin.org/ip | python -mjson.tool grep origin

Version-Release number of selected component:
python-libs-2.7.5-14.fc20

Additional info:
reporter:       libreport-2.2.3
cmdline:        python -mjson.tool grep origin
executable:     /usr/lib64/python2.7/json/tool.py
kernel:         3.16.6-203.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
tool.py:24:main:IOError: [Errno 2] No such file or directory: 'grep'

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib64/python2.7/json/tool.py", line 40, in <module>
    main()
  File "/usr/lib64/python2.7/json/tool.py", line 24, in main
    infile = open(sys.argv[1], 'rb')
IOError: [Errno 2] No such file or directory: 'grep'

Local variables in innermost frame:

Comment 1 Javi Ribera 2014-10-31 13:42:06 UTC
Created attachment 952495 [details]
File: backtrace

Comment 2 Javi Ribera 2014-10-31 13:42:07 UTC
Created attachment 952496 [details]
File: environ

Comment 3 Thomas Spura 2014-10-31 13:49:34 UTC
True that this is a crash in the json module.

But don't you actually want to run:
curl -s http://httpbin.org/ip | python -mjson.tool | grep origin

Note the                                           ^

Comment 4 Javi Ribera 2014-11-04 22:47:08 UTC
I see this is the desired behaviour. The user input was wrong.

Comment 5 Thomas Spura 2014-11-24 17:33:47 UTC
*** Bug 1167416 has been marked as a duplicate of this bug. ***