NoneType to unicode

J

John Morey

My program reads ID3 tags from MP3 files and enters them into a database.
I have been testing it on a variety of MP3s, including ones with
weird characters in the tags (such as norweigan black metal bands)
When this happens it throws the program as they are outside the ascii
range, the program crashes as soon as I try to bind the tag to a string
using the str() function.

I have tried using the encode() function to change the values to unicode
however I cannot do this because they are returned from the id3
library as "NoneType" instances. which means I need to convert
to a string first (which i can't do because it crashes the application)

Any ideas?
cheers
 
A

Alan Franzoni

John Morey on comp.lang.python said:
I have tried using the encode() function to change the values to unicode
however I cannot do this because they are returned from the id3
library as "NoneType" instances. which means I need to convert
to a string first (which i can't do because it crashes the application)

NoneType is just the type of None. It should mean that your ID3 library
returns 'None' when trying to read non-ascii ID3s. I think you should check
your ID3 library, not your main program.

--
Alan Franzoni <[email protected]>
-
Togli .xyz dalla mia email per contattarmi.
Rremove .xyz from my address in order to contact me.
-
GPG Key Fingerprint:
5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top