The code seems to assume ascii file name characters, even though with Django media, the filenames typically originate with users who upload files.
This error is with Django 1.8, Python 2.7, and macOS.
The error is in stdout.write, but there may be other issues as the u'' convention is not used in filename-related code. (from future import unicode_literals might be a good idea).
File "python2.7/site-packages/django_unused_media/management/commands/cleanup_unused_media.py", line 43, in handle
self.stdout.write(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 23: ordinal not in range(128)
The code seems to assume ascii file name characters, even though with Django media, the filenames typically originate with users who upload files.
This error is with Django 1.8, Python 2.7, and macOS.
The error is in stdout.write, but there may be other issues as the u'' convention is not used in filename-related code. (from future import unicode_literals might be a good idea).