martinanton / client175

Automatically exported from code.google.com/p/client175
GNU General Public License v3.0
0 stars 0 forks source link

Editting tags doesn't edit on songs with non-unicode character #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Find a song to edit with a special/non-unicode character
2. Edit it in any field
3. Save changes and see the error

What is the expected output? What do you see instead?
Editted field should be updated, get the error message instead. Other songs get 
editted.

Please use labels and text to provide additional information.
The Error message:

500 Internal Server Error
The server encountered an unexpected condition which prevented it from 
fulfilling the request.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/client175/server.py", line 242, in edit
    print '%s[%s] = "%s"' % (id, tag, val)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 
89: ordinal not in range(128)
Powered by CherryPy 3.2.0

Original issue reported on code.google.com by jeroen.o...@gmail.com on 26 Dec 2011 at 1:19

GoogleCodeExporter commented 8 years ago
Get the same error, saving meta tags with  ö,ä,ü and ß is not working :

500 Internal Server Error

The server encountered an unexpected condition which prevented it from 
fulfilling the request.

Traceback (most recent call last):
  File "/var/www/client175/cherrypy/_cprequest.py", line 606, in respond
    cherrypy.response.body = self.handler()
  File "/var/www/client175/cherrypy/_cpdispatch.py", line 25, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/var/www/client175/server.py", line 249, in edit
    f.write_tags(tags)
  File "/var/www/client175/metadata/_base.py", line 219, in write_tags
    self._set_tag(raw, self.tag_mapping[tag], tagdict[tag])
  File "/var/www/client175/metadata/_id3.py", line 105, in _set_tag
    frame = id3.Frames[tag](encoding=3, text=data)
  File "/var/www/client175/mutagen/id3.py", line 975, in __init__
    self, kwargs.get(checker.name, None))
  File "/var/www/client175/mutagen/id3.py", line 739, in validate
    value = value.split(self.sep)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordina

Original comment by i...@flirt-hunter.de on 25 Jul 2012 at 4:29

GoogleCodeExporter commented 8 years ago
I've had similar error in line 223 (when adding to playlist songs with utf8 
chars). According to 
http://www.saltycrane.com/blog/2008/11/python-unicodeencodeerror-ascii-codec-can
t-encode-character/ i used smart_str function from django, and now it works. 
Try it in your error :)

Original comment by neonk...@gmail.com on 6 Oct 2012 at 9:57