ValueError: min() arg is an empty sequence

Bug #410929 reported by Chen Ming
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mutagen (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When I try to update a mp3 tag from gbk to utf8, I got following error:

cm@pet-desktop:/mnt/xiaomi/E/Music/XT's favourite$ mid3iconv -e gbk AnXiang.mp3
Updating AnXiang.mp3
Traceback (most recent call last):
  File "/usr/bin/mid3iconv", line 135, in <module>
    main(sys.argv)
  File "/usr/bin/mid3iconv", line 125, in main
    update(options, args)
  File "/usr/bin/mid3iconv", line 76, in update
    if min(map(isascii, text)):
ValueError: min() arg is an empty sequence

Revision history for this message
Chen Ming (chenming) wrote :
Revision history for this message
JThundley (jthundley) wrote :

Here's a patch that seems to fix it for your affected file. I don't know if my tiny patch will cause other problems with the program, as I've never used this program before.

The problem seems to be that the TCON tag of that mp3 file is represented as completely blank by mutagen.id3 (i.e. []) where instead an empty tag should always be an empty string (i.e. [u''])

The thing I can't figure out is why the map function on line 76 returns an empty list.

>>> isascii(text)
True
>>> text
[]
>>> isascii(text)
True
>>> map(isascii, text)
[]

Shouldn't map return [True] instead of []?

Revision history for this message
Lukáš Lalinský (luks) wrote :

If you map an empty list to anything, it will always be an empty list.

Revision history for this message
Christoph Reiter (lazka) wrote :

This is fixed since 1.18

Changed in mutagen (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.