UnicodeEncodeError in bluray suggestion searcher.

General development talk regarding Couchpotato
Flatshift
Junior Member
Posts: 3
Joined: 09 Jan 2017 18:12
Status: Offline

UnicodeEncodeError in bluray suggestion searcher.

Postby Flatshift » 09 Jan 2017 18:24

Issue reporting on github looks disabled, so I thought I'd post it here.
I had a lot of problems with the main and outdated binaries from the Arch AUR, so I deleted and recreated my database with a fresh install from GIT.
This fixed a number of issues I was having with the older version, however a new issue popped up that looks to be something specific to the bluray.com suggestion list search.

I found one other mention of this error but that individual was having some other problems as well. I then troubleshot to find it was specific to the bluray.com list being enabled under settings display.

### Steps to reproduce:
1. Default config has Blu-ray.com enabled in Display menu for suggestions on Home page. (Error is present)
2. Settings, display, disable Blu-ray.com suggestion only
3. Clear logs
4. Refresh home page, and check logs, Error is NOT present or incrementing, all other suggestions enabled do not trigger error.
5. Settings, display, enable blue-ray.com suggestion, and disable ALL others.
6. Refresh home page, and check logs. Error is present again.

### Information:
Movie(s) I have this with: n/a
Quality of the movie being searched: n/a
Providers I use: blu-ray.com suggestion
Version of CouchPotato: git:(CouchPotato:CouchPotatoServer master) b538f9a0 (2016-12-21 13:25:09)
Running on: Linux RaspberryPi 4.4.39-1-ARCH #1 SMP Sun Dec 18 18:25:13 MST 2016 armv7l GNU/Linux

### Logs:
```
01-09 11:46:25 ERROR [ couchpotato.core.event] Error in event "automation.get_chart_list", that wasn't caught: Traceback (most recent call last):
File "/opt/couchpotato/couchpotato/core/event.py", line 15, in runHandler
return handler(*args, **kwargs)
File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/base.py", line 44, in _getChartList
return self.getChartList()
File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/bluray.py", line 129, in getChartList
movie = self.search(name, year)
File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/base.py", line 48, in search
cache_name = name.decode('utf-8').encode('ascii', 'ignore')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 15: ordinal not in range(128)
encoding=UTF-8 debug=True args=['--config_file', '/usr/lib/couchpotato/config.ini', '--data_dir', '/usr/lib/couchpotato/data', '--quiet'] app_dir=/opt/couchpotato data_dir=/usr/lib/couchpotato/data desktop=None options=Namespace(config_file='/usr/lib/couchpotato/config.ini', console_log=False, daemon=False, data_dir='/usr/lib/couchpotato/data', debug=False, pid_file='/usr/lib/couchpotato/data/couchpotato.pid', quiet=True)
```

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: UnicodeEncodeError in bluray suggestion searcher.

Postby clinton.hall » 10 Jan 2017 01:24

it appears the bluray charts are returning something with the character è that is not being encoded correctly.

this is not casuing any issue on my system. Was this a temporary issue relating to a particular title on bluray charts (i.e is it working now)?

Flatshift
Junior Member
Posts: 3
Joined: 09 Jan 2017 18:12
Status: Offline

Re: UnicodeEncodeError in bluray suggestion searcher.

Postby Flatshift » 10 Jan 2017 03:55

Just tested again, and I do still see it.

Looks like it's: <title>Puccini: La Bohème (Blu-ray)</title>
From the feed specified by bluray.py line 19 - http://www.blu-ray.com/rss/newreleasesfeed.xml

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: UnicodeEncodeError in bluray suggestion searcher.

Postby clinton.hall » 10 Jan 2017 04:18

weird. mine does not give the error, or display that movie. In fact mine only displays some of the movies... I guess there is more going on behind the scenes to only display movies based on genre etc based on my existing collection.

in anycase, it would appear that a different encoding is needed to display this.

File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/base.py", line 48, in search
cache_name = name.decode('utf-8').encode('ascii', 'ignore')

try changing this to
cache_name = name.decode('utf-8','replace').encode('ascii', 'replace')

Flatshift
Junior Member
Posts: 3
Joined: 09 Jan 2017 18:12
Status: Offline

Re: UnicodeEncodeError in bluray suggestion searcher.

Postby Flatshift » 10 Jan 2017 05:23

Hrm, no luck it seems.

### Logs:
```
01-09 23:03:44 ERROR [ couchpotato.core.event] Error in event "automation.get_chart_list", that wasn't caught: Traceback (most recent call last):
File "/opt/couchpotato/couchpotato/core/event.py", line 15, in runHandler
return handler(*args, **kwargs)
File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/base.py", line 44, in _getChartList
return self.getChartList()
File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/bluray.py", line 129, in getChartList
movie = self.search(name, year)
File "/opt/couchpotato/couchpotato/core/media/movie/providers/automation/base.py", line 48, in search
cache_name = name.decode('utf-8','replace').encode('ascii', 'replace')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe8' in position 15: ordinal not in range(128)
encoding=UTF-8 debug=False args=['--config_file', '/usr/lib/couchpotato/config.ini', '--data_dir', '/usr/lib/couchpotato/data', '--quiet'] app_dir=/opt/couchpotato data_dir=/usr/lib/couchpotato/data desktop=None options=Namespace(config_file='/usr/lib/couchpotato/config.ini', console_log=False, daemon=False, data_dir='/usr/lib/couchpotato/data', debug=False, pid_file='/usr/lib/couchpotato/data/couchpotato.pid', quiet=True)
```

I thought only suggestions displays recommendations based on library. The Blu-ray.com looks to be a simple rss feed list. Seems it fails to actually display the blu-ray.com list on the home screen with this error. All of the other display options work fine, but they probably aren't giving me anything characters a grave accent at the moment.

Is the difference in my US locale possibly? My system is set to en_US.UTF-8. Though I wouldn't necessarily want to change that.

Either way, I appreciate your efforts.

User avatar
clinton.hall
Moderator
Posts: 9224
Joined: 28 Jun 2012 12:55
Has thanked: 94 times
Been thanked: 465 times
Contact:
Status: Offline

Re: UnicodeEncodeError in bluray suggestion searcher.

Postby clinton.hall » 10 Jan 2017 06:54

I don't think the locale is the issue... but I am confused by this. the rror is "encoding" but the traceback shows an issue with decoding...


Return to “Development”