Plex-Cleaner icon indicating copy to clipboard operation
Plex-Cleaner copied to clipboard

Crash while cleaning on odd character

Open Veronit opened this issue 6 years ago • 4 comments

Cleaner crahses when it encounters an odd character on episode name. The episode name in question is "Búho/Muwan" I'm guessing it's the "ú" character.

Log:

Mayans M C - S01xE003 - Episode 3 | Viewed: 2 | Days Since Last Viewed: 1 | On Deck: False Traceback (most recent call last): File "PlexCleaner.py", line 1169, in changed += checkShow(DirectoryNode) File "PlexCleaner.py", line 868, in checkShow log('[Keeping] ' + getLocalPath(ep['file'])) File "PlexCleaner.py", line 533, in getLocalPath if file.startswith(Settings['RemoteMount']): UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 70: ordinal not in range(128)

Veronit avatar Sep 22 '18 07:09 Veronit

have you tried running it with the --reload_encoding flag?

e.g. do 'PlexCleaner.py --reload_encoding'

I had this same issue a couple of weeks ago, even with that flag enabled actually, but didn't have time to create an issue in here.

JohanSF avatar Sep 22 '18 07:09 JohanSF

Didn't try that. I manually deleted the episode in question so I could continue debugging why cleaner isn't cleaning stuff.

Veronit avatar Sep 22 '18 07:09 Veronit

I'm getting something similar when I set 'cleanup_movie_folders: true' in my config.

Cleaning up orphaned folders less than 30MB in Section 1 Traceback (most recent call last): File "PlexCleaner.py", line 1271, in <module> changed = checkMovies(doc, Section) File "PlexCleaner.py", line 787, in checkMovies cleanUpFolders(section, Settings['minimum_folder_size']) File "PlexCleaner.py", line 807, in cleanUpFolders if os.path.isdir(dir_path): File "/usr/lib/python2.7/genericpath.py", line 49, in isdir st = os.stat(s) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 33: ordinal not in range(128)

I tried the --reload_encoding flag however it didn't have any effect.

markolonius avatar Feb 03 '20 00:02 markolonius

This seems to be an issue with python 2.x and utf8 encoding. Try running PlexCleaner with python 3.x. Alternately, check the answer about utf8 default encoding on this stackoverflow answer: https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20

ctflora avatar Feb 03 '20 15:02 ctflora