pixelb / fslint

Linux file system lint checker/cleaner
319 stars 72 forks source link

Bad options causes crash on fslint-gui #84

Closed pixelb closed 9 years ago

pixelb commented 9 years ago

Original issue 85 created by pixelb on 2013-02-12T23:17:07.000Z:

What steps will reproduce the problem?

  1. ./fslint-gui --blarg (or any non-supported flag)

What is the expected output? What do you see instead? Expected is the Usage output, instead there is a crash. $ ./fslint-gui --versoin Traceback (most recent call last): File "./fslint-gui", line 185, in <module> puts(msg) File "./fslint-gui", line 36, in puts sys.stdout.write(string+'\n') TypeError: unsupported operand type(s) for +: 'GetoptError' and 'str'

What version of the product are you using? On what operating system? 2.42. Tested on Debian and RHEL 6.3

Please provide any additional information below.

I was messing about with fslint when I fat-fingered the version flag. Turns out that "--versoin" causes a crash.

I looked at the function puts and had it spit out the type being passed into puts: <class 'getopt.GetoptError'> . Ah. A quick string conversion fixes that.

The puts function in fslint-gui:

def puts(string=""): #print is problematic in python 3

Original function

#   sys.stdout.write(string+'\n')
#   Modified function
    sys.stdout.write(str(string)+'\n')
pixelb commented 9 years ago

Comment #1 originally posted by pixelb on 2013-02-12T23:20:01.000Z:

Doh. Typo. I meant version 2.43 from svn. I just copied the output from the last system I tested on which happened to be 2.42. :)

pixelb commented 9 years ago

Comment #2 originally posted by pixelb on 2013-02-13T09:11:45.000Z:

Thanks! Pushed r283 in your name