zacharydenton/whatbetter — Issue #6: Fails to create torrents when filenames contain non-ASCII chars
Author: dannyperson
Created: 2012-02-26 23:43:57+00:00
State: open

A bunch of my stuff has non-english chars in the filenames.

The encoders encode the files happily, but when it comes to creating the torrent, errors like "Error adding format AAC: 'ascii' codec can't encode character u'\xe8' in position 73: ordinal not in range(128)" show up and the torrent is not created (and is not uploaded).

I'm on Python 2.7.2 on Gentoo using $LANG en_US.UTF-8.

After examining the source, the error definitely occurs when the subprocess.call line in make_torrent is run. I think it's caused by input_dir being of type str when it contains unicode bytes. Whatever calls it needs to create the filename strings as type unicode and not str. I don't want to further investigate it because the code confuses me, but it's probably somewhere in whatbrowser.py that creates the dir names as a str incorrectly.

-Dan