asciidisco / asciidisco/plugin.video.netflix

UnicodeDecodeError for profile names without ASCII characters

Open
#562 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.2k
Forks
213
PR merge metrics
No merged PRs in 30d

Description

*I'm submitting a ...*
- [x] bug report
- [ ] feature request
- [ ] support request

## General infomration

r5342284 downloaded as zip and installed as is on LibreELEC

/resources/lib/KodiHelper.py
unescaped_profile_name = html_parser.unescape(enc_profile_name)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in range(128)

### Description

> EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
> - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
> Error Type:
> Error Contents: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in range(128)
> Traceback (most recent call last):
> File "/storage/.kodi/addons/plugin.video.netflix/addon.py", line 33, in
> NAVIGATION.router(paramstring=REQUEST_PARAMS)
> File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/utils.py", line 60, in wrapped
> result = func(*args, **kwargs)
> File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py", line 148, in router
> return self.show_profiles()
> File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/utils.py", line 60, in wrapped
> result = func(*args, **kwargs)
> File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/Navigation.py", line 592, in show_profiles
> build_url=self.build_url)
> File "/storage/.kodi/addons/plugin.video.netflix/resources/lib/KodiHelper.py", line 228, in build_profiles_listing
> unescaped_profile_name = html_parser.unescape(enc_profile_name)
> File "/usr/lib/python2.7/HTMLParser.py", line 476, in unescape
> File "/usr/lib/python2.7/re.py", line 155, in sub
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in range(128)
> -->End of Python script error report<--

### Installation

* [x] I installed the plugin via zip from the Releases page
* [ ] I´m using the Netflix Repo
* [ ] I´m using a different source (Please tell which)

### Operating System

* [ ] Linux (x86/x64)
* [ ] OSX (x86/x64)
* [ ] Windows (x86/x64)
* [x] Linux (ARM)
* [ ] Android

#### Additional informatin on the environment

18.0-RC1 Git:newclock5_18.0rc1-Leia
Linux ARM 32-bit
Using Release Kodi x32 build (version for Raspberry Pi)
Kodi compiled Nov 25 2018 by GCC 8.2.0 for Linux ARM 32-bit version 4.19.4 (267012)
Running on LibreELEC (official): 8.90.008 9.0, kernel: Linux ARM 32-bit version 4.19.4

## Debug log

http://paste.kodi.tv/bonaruvaze

Contributor guide

Open the contributing guide

Research direction

Start in resources/lib/KodiHelper.py at build_profiles_listing and the unescaped_profile_name assignment shown in the traceback. Reproduce the profile-listing path with a name containing non-ASCII characters and inspect how Python 2 HTMLParser.unescape handles enc_profile_name. Done means the profile listing no longer raises UnicodeDecodeError for such names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.