From 4d801a02c5f73d9b0a3d7a5d6e72c35752e38708 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 30 Jul 2013 10:53:58 +0200 Subject: [PATCH] PluginDownloader: Fix @info for Python 3. --- plugins/PluginDownloader/plugin.py | 5 ++++- plugins/PluginDownloader/test.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/PluginDownloader/plugin.py b/plugins/PluginDownloader/plugin.py index db8f37f82..1858f85fd 100644 --- a/plugins/PluginDownloader/plugin.py +++ b/plugins/PluginDownloader/plugin.py @@ -153,7 +153,10 @@ class GithubRepository(GitRepository): for file in archive.getmembers(): if file.name.startswith(prefix + dirname + '/README'): extractedFile = archive.extractfile(file) - return extractedFile.read() + content = extractedFile.read() + if sys.version_info[0] >= 3: + content = content.decode() + return content def _getWritableDirectoryFromList(self, directories): for directory in directories: diff --git a/plugins/PluginDownloader/test.py b/plugins/PluginDownloader/test.py index 526cea7cd..58c3a0d9b 100644 --- a/plugins/PluginDownloader/test.py +++ b/plugins/PluginDownloader/test.py @@ -92,6 +92,11 @@ class PluginDownloaderTestCase(PluginTestCase): self.assertNotError('plugindownloader install SpiderDave Pastebin') self._testPluginInstalled('Pastebin') + def testInfo(self): + self.assertResponse('plugindownloader info ProgVal Twitter', + 'Advanced Twitter plugin for Supybot, with capabilities ' + 'handling, and per-channel user account.') + if not network: class PluginDownloaderTestCase(PluginTestCase): pass