Skip to content

Commit

Permalink
Fix guessit UnicodeDecodeError on join (Py2) (#7192)
Browse files Browse the repository at this point in the history
* Fix UnicodeDecodeError on join (Py2)

* Use representation for exception logging

* Update CHANGELOG.md
  • Loading branch information
medariox authored and p0psicles committed Oct 3, 2019
1 parent 6473647 commit 3024073
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
- Shows without any episodes can now be added ([#6977](https://github.com/pymedusa/Medusa/pull/6977))

#### Fixes
- Fix AnimeBytes dailysearch, for multi-ep results ([#7190](https://github.com/pymedusa/Medusa/pull/7190))
- Fixed AnimeBytes daily search, for multi-ep results ([#7190](https://github.com/pymedusa/Medusa/pull/7190))
- Fixed rare UnicodeDecodeError when parsing titles with Python 2.7 ([#7192](https://github.com/pymedusa/Medusa/pull/7192))

-----

Expand Down
5 changes: 4 additions & 1 deletion medusa/name_parser/rules/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,10 @@ def when(self, matches, context):
# adjust title to append the series name.
# Only the season.parent contains the S prefix in its value
new_title = copy.copy(title)
new_title.value = ' '.join([title.value, season.parent.value])
if six.PY3:
new_title.value = ' '.join([title.value, season.parent.value])
else:
new_title.value = b' '.join([title.value, season.parent.value])
new_title.end = season.end

# other fileparts might have the same season to be removed from the matches
Expand Down
2 changes: 1 addition & 1 deletion medusa/search/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def run(self):

except Exception as error:
self.success = False
log.exception('DailySearchQueueItem Exception, error: {error}', {'error': error})
log.exception('DailySearchQueueItem Exception, error: {error!r}', {'error': error})

if self.success is None:
self.success = False
Expand Down

0 comments on commit 3024073

Please sign in to comment.