Bug 706946

Summary: [abrt] python-pep8-0.6.0-2.fc14: pep8.py:723:readlines:IOError: [Errno 2] No such file or directory: 'com'
Product: [Fedora] Fedora Reporter: Pierre-YvesChibon <pingou>
Component: python-pep8Assignee: Ian Weller <ian>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: ian
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:a6bde974
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-16 21:53:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace none

Description Pierre-YvesChibon 2011-05-23 14:56:40 UTC
abrt version: 1.1.18
architecture: x86_64
cmdline: /usr/bin/python /usr/bin/pep8 com
component: python-pep8
executable: /usr/bin/pep8
kernel: 2.6.35.13-91.fc14.x86_64
package: python-pep8-0.6.0-2.fc14
reason: pep8.py:723:readlines:IOError: [Errno 2] No such file or directory: 'com'
release: Fedora release 14 (Laughlin)
time: 1306162496
uid: 500

backtrace
-----
pep8.py:723:readlines:IOError: [Errno 2] No such file or directory: 'com'

Traceback (most recent call last):
  File "/usr/bin/pep8", line 9, in <module>
    load_entry_point('pep8==0.6.0', 'console_scripts', 'pep8')()
  File "/usr/lib/python2.7/site-packages/pep8.py", line 1346, in _main
    runner(path)
  File "/usr/lib/python2.7/site-packages/pep8.py", line 1027, in input_file
    errors = Checker(filename).check_all()
  File "/usr/lib/python2.7/site-packages/pep8.py", line 827, in __init__
    self.lines = readlines(filename)
  File "/usr/lib/python2.7/site-packages/pep8.py", line 723, in readlines
    return open(filename).readlines()
IOError: [Errno 2] No such file or directory: 'com'

Local variables in innermost frame:
filename: 'com'

comment
-----
I tried to run pep8 on a "compare.py" but the tab completion blocked and I ran pep8 only on "com".

Pep8 should catch the exception if the file against which one try to run it doesn't exist.

For example:
$ pep8 blasdlkjalfhvhdnvuhbad

How to reproduce
-----
1. run pep8 with an invalid argument
2.
3.

Comment 1 Pierre-YvesChibon 2011-05-23 14:56:43 UTC
Created attachment 500452 [details]
File: backtrace

Comment 2 Pierre-YvesChibon 2012-06-17 08:55:53 UTC
Hey Ian, may I ask why this resolution ?

Comment 3 Ian Weller 2012-06-17 19:06:26 UTC
Because I don't think it's a bug :)

The exception very plainly says what's going on, it's meant to be a command line application used by Python developers that understand exceptions, and the only reason it's here is because abrt caught it because it's an exception.

If you believe catching the exception is trivial, please send a patch upstream.