torrent_error('Unknown name')
name = info['name']
+ encoding = torrent.get('encoding', None)
+
if 'files' in info:
files = info['files']
paths = []
- encoding = torrent.get('encoding', None)
for file in files:
if 'path' not in file:
torrent_error('Unknown path')
if 'length' not in info:
torrent_error('Unknown length')
length = info['length']
+ if charset and encoding and (charset != encoding):
+ name = name.decode(encoding, 'replace').encode(charset, 'replace')
paths = [(name, length)]
meta = []
def mctorrent_copyin():
"""Put a file to the VFS"""
- sys.exit("Torrent VFS doesn't support adding files")
+ sys.exit("Torrent VFS doesn't support adding files (read-only filesystem)")
def mctorrent_rm():
"""Remove a file from the VFS"""
- sys.exit("Torrent VFS doesn't support removing files/directories")
+ sys.exit("Torrent VFS doesn't support removing files/directories (read-only filesystem)")
mctorrent_rmdir = mctorrent_rm
def mctorrent_mkdir():
"""Create a directory in the VFS"""
- sys.exit("Torrent VFS doesn't support creating directories")
+ sys.exit("Torrent VFS doesn't support creating directories (read-only filesystem)")
def torrent_error(error_str):