-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2246 from lfdversluis/issue-2236-torrents-decode-…
…chardet Introduced chardet, the fullpath is now decoded with chardet
- Loading branch information
Showing
5 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
This package contains tests for the Utilities module in Tribler/Core. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# coding=utf-8 | ||
import os | ||
|
||
from Tribler.Core.Utilities.maketorrent import pathlist2filename | ||
from Tribler.Test.test_as_server import BaseTestCase | ||
|
||
|
||
class TestMakeTorrent(BaseTestCase): | ||
|
||
def test_pathlist2filename_utf8(self): | ||
path_list = [u"test", u"path"] | ||
path = pathlist2filename(path_list) | ||
self.assertEqual(path, os.path.join(u"test", u"path")) | ||
|
||
def test_pathlist2filename_not_utf8(self): | ||
part = u'\xb0\xe7'.encode("latin-1") | ||
path_list = ["test", part] | ||
path = pathlist2filename(path_list) | ||
self.assertEqual(path, os.path.join(u"test", u"\xb0\xe7")) |