mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Fix loading improperly created torrents with mismatched encodings
This commit is contained in:
parent
abc5bcf389
commit
fbb5cd94e8
2 changed files with 6 additions and 5 deletions
|
@ -1,12 +1,13 @@
|
||||||
=== Deluge 1.1.7 - (In Development) ===
|
=== Deluge 1.1.7 - (In Development) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
* Fix issue where cannot resume torrent after doing a 'Pause All'
|
* Fix issue where cannot resume torrent after doing a 'Pause All'
|
||||||
|
|
||||||
==== GtkUI ====
|
==== GtkUI ====
|
||||||
* Fix #883 segfault if locale is not using UTF-8 encoding
|
* Fix #883 segfault if locale is not using UTF-8 encoding
|
||||||
* Fix for adding torrents with invalid filename encodings
|
* Fix for adding torrents with invalid filename encodings
|
||||||
* Fix displaying IPv6 peers in the Peers tab
|
* Fix displaying IPv6 peers in the Peers tab
|
||||||
* Fix starting the daemon in OS X
|
* Fix starting the daemon in OS X
|
||||||
|
* Fix loading improperly created torrents with mismatched encodings
|
||||||
|
|
||||||
=== Deluge 1.1.6 - (06 April 2009) ===
|
=== Deluge 1.1.6 - (06 April 2009) ===
|
||||||
==== Core ====
|
==== Core ====
|
||||||
|
|
|
@ -70,24 +70,24 @@ class TorrentInfo(object):
|
||||||
if self.__m_metadata["info"].has_key("files"):
|
if self.__m_metadata["info"].has_key("files"):
|
||||||
prefix = ""
|
prefix = ""
|
||||||
if len(self.__m_metadata["info"]["files"]) > 1:
|
if len(self.__m_metadata["info"]["files"]) > 1:
|
||||||
prefix = self.__m_metadata["info"]["name"].decode(self.encoding).encode("utf8")
|
prefix = self.__m_metadata["info"]["name"].decode(self.encoding, "replace").encode("utf8")
|
||||||
|
|
||||||
for f in self.__m_metadata["info"]["files"]:
|
for f in self.__m_metadata["info"]["files"]:
|
||||||
self.__m_files.append({
|
self.__m_files.append({
|
||||||
'path': os.path.join(prefix, *f["path"]).decode(self.encoding).encode("utf8"),
|
'path': os.path.join(prefix, *f["path"]).decode(self.encoding, "replace").encode("utf8"),
|
||||||
'size': f["length"],
|
'size': f["length"],
|
||||||
'download': True
|
'download': True
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.__m_files.append({
|
self.__m_files.append({
|
||||||
"path": self.__m_metadata["info"]["name"].decode(self.encoding).encode("utf8"),
|
"path": self.__m_metadata["info"]["name"].decode(self.encoding, "replace").encode("utf8"),
|
||||||
"size": self.__m_metadata["info"]["length"],
|
"size": self.__m_metadata["info"]["length"],
|
||||||
"download": True
|
"download": True
|
||||||
})
|
})
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.__m_metadata["info"]["name"].decode(self.encoding).encode("utf8")
|
return self.__m_metadata["info"]["name"].decode(self.encoding, "replace").encode("utf8")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def info_hash(self):
|
def info_hash(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue