I have two lists containing unicode strings. I'm trying to remove every element from availablesongs that also appears in recentsongs.
The following code is causing the problem (exception clause commented out for debugging):
for x in recentsongs:
#try:
availablesongs.remove(x)
#except ValueError:
# pass
This code works fine when the lists contain ASCII-only strings, but when characters from other languages are introduced, it fails:
UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
availablesongs.remove(x)
ValueError: list.remove(x): x not in list
The error is coming from the remove() function itself, which has me stumped. How can I work around this?