Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is lovely - thanks a lot!

I listen to a lot of foreign music and have had a hard time populating my zmusic database. There's a work-around (decode the relevant strings to Unicode) that seems to have worked but I have to leave for work before I'll be able to test this fully. I've never submitted a patch before and hope to use this as an opportunity to learn how to make one.

I have a basic question, however: why did you decide to use tab characters in your python? Most libs whose code I've read use spaces but I've never seen an argument for one convention or the other.



> I listen to a lot of foreign music and have had a hard time populating my zmusic database

Oh noes! I too have lots of foreign music in my collection, and it seemed to work fine. I'm using the tagging framework out of MusicBrainz' Picard application, so things should be pretty flawless. I wonder what happened... Maybe the encoding system-wide needs to be set to UTF-8 so Python picks this up? If you email me more information, I can take a look.

> why did you decide to use tab characters in your python?

I'm partial to Linux-kernel C-style. I like tabs. That's what they're for. Holy wars though. What else? I use VIM, KDE, and Gentoo. Death to Emacs, Gnome, and Mandrake! Ahh, preferences...


I ran into this problem as well. It seems that the filesystem paths should not contain non-ASCII characters. In my case, my music is stored in ~/Música and scan.py fails on every single audio file it finds.

> ProgrammingError: (ProgrammingError) You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. u'SELECT songs.filename AS songs_filename, songs.id AS songs_id, songs.title AS songs_title, songs.album AS songs_album, songs.artist AS songs_artist, songs.mimetype AS songs_mimetype, songs.year AS songs_year, songs.track AS songs_track, songs.disc AS songs_disc, songs.lastmodified AS songs_lastmodified, songs.filesize AS songs_filesize, songs.length AS songs_length \nFROM songs \nWHERE songs.filename = ?' ('/home/dschulz/M\xc3\xbasica/Michel_Petrucciani/Blue_Note/06-Trouble.mp3',)




OT, but spaces are more common because they're strongly recommended by PEP 8, the community style guide for Python code.

http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces


Yea. Yea, yea. Yea...

But I like tabs. Old habit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: