-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
The below code doesn't handle Unicode strings properly:
pyrocore/src/pyrocore/scripts/lstor.py
Line 120 in bf48ceb
| values.append("%s" % val) |
In case torrent file has __file__ encoded with UTF-8, values ends up having a mixed bag of str and unicode types. join() used afterwards is not supposed to handle this and fails with UnicodeEncodeError:
$
lstor -qo info.name,__file__ Tést.torrent
WARNING Bad metafile 'T\xc3\xa9st.torrent' (UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128))
The problem is the chosen use of "%s" % val which does not yield consistent results encoding-wise.
ryanerwin
Metadata
Metadata
Assignees
Labels
No labels