5 ms·
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 rel
by ejstronge 14y ago
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.
- zx2c4 14y ago> 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...
- dschulz 14y agoI 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',)
- zx2c4 14y agoUnicode issue fixed in the repo. http://git.zx2c4.com/zmusic-ng/commit/?id=297514d6e6c42057ee769f19a3b9b4ed7127d503 http://git.zx2c4.com/zmusic-ng/commit/?id=297514d6e6c42057ee...
- zx2c4 14y agoUPDATE! Unicode issue fixed: http://git.zx2c4.com/zmusic-ng/commit/?id=297514d6e6c42057ee769f19a3b9b4ed7127d503 http://git.zx2c4.com/zmusic-ng/commit/?id=297514d6e6c42057ee...
- graue 14y agoOT, 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 http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces
- zx2c4 14y agoYea. Yea, yea. Yea... But I like tabs. Old habit.