# Buggy code
def __init__(self, parent, wxid=wx.ID_ANY, style=0, agwStyle=0):
    ULC.UltimateListCtrl.__init__(
        self, parent, wxid, wx.DefaultPosition, wx.DefaultSize, style, agwStyle
    )

    self.guiutility = GUIUtility.getInstance()
    self.boosting_manager = self.guiutility.utility.session.lm.boosting_manager

    self.channel_list = {}

    self._logger = logging.getLogger(self.__class__.__name__)

    self.InsertColumn(0, "col")
    self.SetColumnWidth(0, -3)

    # index holder for labels. 0 for RSS, 1 for directory, 2 for channel
    self.labels = [0, 1, 2]

    self.InsertStringItem(self.labels[0], "RSS")
    item = self.GetItem(self.labels[0])
    item.Enable(False)
    item.SetData("RSS")
    self.SetItem(item)

    self.InsertStringItem(self.labels[1], "Directory")
    item = self.GetItem(self.labels[1])
    item.Enable(False)
    item.SetData("Directory")
    self.SetItem(item)

    self.InsertStringItem(self.labels[2], "Channel")
    item = self.GetItem(self.labels[2])
    item.Enable(False)
    item.SetData("Channel")
    self.SetItem(item)

    self.Bind(EVT_LIST_ITEM_CHECKED, self.OnGetItemCheck)

    self.getting_channels = False
    self._mainWin.Bind(wx.EVT_SCROLLWIN, self.on_scroll)


# Traceback (isError)
Regression

Tribler.Test.Core.Modules.RestApi.test_downloads_endpoint.TestDownloadsEndpoint.test_remove_download_no_remove_data_param (from nosetests)
Failing for the past 1 build (Since Failed#2109 )
Took 4.4 sec.
Error Message

Test raised 1 unhandled Twisted exceptions:
[{'log_namespace': u'log_legacy', 'log_time': 1467938979.639, 'format': '%(log_legacy)s', 'log_system': '-', 'log_legacy': <twisted.logger._stdlib.StringifiableFromEvent object at 0x06D22830>, 'log_level': <LogLevel=critical>, 'system': '-', 'isError': 1, 'failure': <twisted.python.failure.Failure exceptions.AttributeError: 'NoneType' object has no attribute 'add_task'>, 'time': 1467938979.639, 'log_text': 'Unhandled Error\nTraceback (most recent call last):\n  File "C:\\Python27\\lib\\threading.py", line 763, in run\n    self.__target(*self.__args, **self.__kwargs)\n  File "C:\\workspace\\jenkins\\workspace\\GH_Tribler_PR_tests_win32\\tribler\\Tribler\\Core\\Utilities\\twisted_thread.py", line 55, in _reactor_runner\n    reactor.run(installSignalHandlers=False)\n  File "C:\\Python27\\lib\\site-packages\\twisted\\internet\\base.py", line 1194, in run\n    self.mainLoop()\n  File "C:\\Python27\\lib\\site-packages\\twisted\\internet\\base.py", line 1203, in mainLoop\n    self.runUntilCurrent()\n--- <exception caught here> ---\n  File "C:\\Python27\\lib\\site-packages\\twisted\\internet\\base.py", line 825, in runUntilCurrent\n    call.func(*call.args, **call.kw)\n  File "C:\\workspace\\jenkins\\workspace\\GH_Tribler_PR_tests_win32\\tribler\\Tribler\\Core\\Libtorrent\\__init__.py", line 27, in <lambda>\n    lambda_f = lambda a = args, kwa = kwargs: invoke_func(*a, **kwa)\n  File "C:\\workspace\\jenkins\\workspace\\GH_Tribler_PR_tests_win32\\tribler\\Tribler\\Core\\Libtorrent\\__init__.py", line 28, in invoke_func\n    download.session.lm.threadpool.add_task(lambda_f, 1)\nexceptions.AttributeError: \'NoneType\' object has no attribute \'add_task\'\n', 'log_format': u'{log_text}', 'message': (), 'why': None}]

# Fixed code
def __init__(self, parent, wxid=wx.ID_ANY, style=0, agwStyle=0):
    ULC.UltimateListCtrl.__init__(
        self, parent, wxid, wx.DefaultPosition, wx.DefaultSize, style, agwStyle
    )
    TaskManager.__init__(self)

    self.guiutility = GUIUtility.getInstance()
    self.boosting_manager = self.guiutility.utility.session.lm.boosting_manager

    self.channel_list = {}

    self._logger = logging.getLogger(self.__class__.__name__)

    self.InsertColumn(0, "col")
    self.SetColumnWidth(0, -3)

    # index holder for labels. 0 for RSS, 1 for directory, 2 for channel
    self.labels = [0, 1, 2]

    self.InsertStringItem(self.labels[0], "RSS")
    item = self.GetItem(self.labels[0])
    item.Enable(False)
    item.SetData("RSS")
    self.SetItem(item)

    self.InsertStringItem(self.labels[1], "Directory")
    item = self.GetItem(self.labels[1])
    item.Enable(False)
    item.SetData("Directory")
    self.SetItem(item)

    self.InsertStringItem(self.labels[2], "Channel")
    item = self.GetItem(self.labels[2])
    item.Enable(False)
    item.SetData("Channel")
    self.SetItem(item)

    self.Bind(EVT_LIST_ITEM_CHECKED, self.OnGetItemCheck)

    self.getting_channels = False
    self._mainWin.Bind(wx.EVT_SCROLLWIN, self.on_scroll)