leosongwei / mutagen

Automatically exported from code.google.com/p/mutagen
GNU General Public License v2.0
0 stars 0 forks source link

mid3iconv: Throws error and halts when destination is a directory #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm submitting this patch to resolve 
https://bugzilla.redhat.com/show_bug.cgi?id=641591

Reproduce:

svn co -r 98 http://mutagen.googlecode.com/svn/trunk/ mutagen
cd mutagen/tools
mkdir test
./mid3iconv test

Traceback (most recent call last):
  File "./mid3iconv", line 139, in <module>
    main(sys.argv)
  File "./mid3iconv", line 129, in main
    update(options, args)
  File "./mid3iconv", line 52, in update
    if has_id3v1(filename) and not noupdate and force_v1:
  File "./mid3iconv", line 94, in has_id3v1
    f = open(filename, 'rb+')
IOError: [Errno 21] Is a directory: 'test'

Expected results:

./mid3iconv test 
Not a regular file: test

or whatever error message(s) you like most.

Original issue reported on code.google.com by si...@sewell.ch on 30 Dec 2010 at 5:17

Attachments:

GoogleCodeExporter commented 9 years ago
Please apply the patch in r99 instead. Asking permission to open the file is 
bad design because there are too many things to ask.

Original comment by joe.wreschnig@gmail.com on 30 Dec 2010 at 10:35