On Wed, Aug 19, 2009 at 6:35 AM, fruity<[email protected]> wrote:
>
> I do not know yet wich file has the title tag that raise the exception,
> and if I may say, whouldn't be easyer to get the build_list stuff in an
> external util.py and than import it in the view? just for clearance...
>
> Ciao
>
> q9c9p
>

Well, technically speaking mediapool was created as my 'utility' app
and separated from the controller app.  I am really open to any
suggestions on this whole scanning business since a web-based call is
too 'stateless' to handle scanning large filesystems.

That said, your tag errors related to encoding are really happening in
the mediapool Model methods for the Song model.  When build_file_list
finds a file and decides to save it to the database,
mediapool/models.py reads the tags, saves them to the database for
each song, setting up the appropriate foreign keys where necessary.

Some things I found googling...

Discussion on os.walk and char encodings:
http://www.gossamer-threads.com/lists/python/python/700968

Quote:
"> I tend to have everything internally in Unicode but it's often unclear
> how to convert some inputs to Unicode in the first place. What are the
> best practices for dealing with these chraset issues in Python?

I'm usually using UTF-8 as default but offer the user ways, e.g. command
line switches, to change that.

If I have to display file names in a GUI I use a decoded version of the
byte string file name, but keep the byte string for operations on the
file. "

Post about International Characters in Python:
http://blog.expandrive.com/2008/05/06/finessing-international-characters-out-of-python/

Quote:
"The situation I have is with (debian, apache2, mod_python, python2.6)
and the os.walk function. It always fail with non-ascii filenames that
are very common in a music storage, (the cost we have by enjoying
music of all around the world)."

We may be able to leverage some of these suggestions.  In the
meantime, I am going to try to replicate some of these errors be
placing Latin-1 filenames in my scan directory.  Whatever we can
figure out on the os.walk should also be able to be leveraged on the
Tag side as well.


-- 
Chris Everest

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to