# Buggy code
def __init__(self, settings):
    QMainWindow.__init__(self)

    self.request_mgr = None
    self.cpu_plot = None
    self.memory_plot = None
    self.initialized_cpu_plot = False
    self.initialized_memory_plot = False
    self.cpu_plot_timer = None
    self.memory_plot_timer = None

    uic.loadUi(get_ui_file_path("debugwindow.ui"), self)
    self.setWindowTitle("Tribler debug pane")

    self.window().debug_tab_widget.setCurrentIndex(0)
    self.window().dispersy_tab_widget.setCurrentIndex(0)
    self.window().system_tab_widget.setCurrentIndex(0)
    self.window().debug_tab_widget.currentChanged.connect(self.tab_changed)
    self.window().dispersy_tab_widget.currentChanged.connect(self.dispersy_tab_changed)
    self.window().events_tree_widget.itemClicked.connect(self.on_event_clicked)
    self.window().system_tab_widget.currentChanged.connect(self.system_tab_changed)
    self.load_general_tab()

    self.window().open_files_tree_widget.header().setSectionResizeMode(
        0, QHeaderView.Stretch
    )

    if not settings["trustchain"]["enabled"]:
        self.window().debug_tab_widget.setTabEnabled(2, False)


# Traceback (AssertionError)
Tuples differ: (2, ('127.0.0.1', [5, 4, 3, 2,... != (2, ('127.0.0.1', [5, 4, 3, 2,...

First differing element 2:
u'None'
''

- (2, ('127.0.0.1', [5, 4, 3, 2, 1]), u'None')
?                                     - ----

+ (2, ('127.0.0.1', [5, 4, 3, 2, 1]), '')
Stacktrace

Traceback (most recent call last):
File "c:\python27\lib\unittest\case.py", line 329, in run
testMethod()
File "C:\workspace\jenkins\workspace\GH_Tribler_PR_tests_win64\tribler\Tribler\Test\test_as_server.py", line 58, in check
result = fun(*argv, **kwargs)
File "C:\workspace\jenkins\workspace\GH_Tribler_PR_tests_win64\tribler\Tribler\Test\Core\Upgrade\test_config_upgrade_70_71.py", line 33, in test_read_test_libtribler_conf
self.assertEqual(result_config.get_anon_proxy_settings(), (2, ("127.0.0.1", [5, 4, 3, 2, 1]), ''))
File "c:\python27\lib\unittest\case.py", line 513, in assertEqual
assertion_func(first, second, msg=msg)
File "c:\python27\lib\unittest\case.py", line 753, in assertTupleEqual
self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)
File "c:\python27\lib\unittest\case.py", line 724, in assertSequenceEqual
self.fail(msg)
File "c:\python27\lib\unittest\case.py", line 410, in fail
raise self.failureException(msg)
AssertionError: Tuples differ: (2, ('127.0.0.1', [5, 4, 3, 2,... != (2, ('127.0.0.1', [5, 4, 3, 2,...

First differing element 2:
u'None'
''

- (2, ('127.0.0.1', [5, 4, 3, 2, 1]), u'None')
?                                     - ----

+ (2, ('127.0.0.1', [5, 4, 3, 2, 1]), '')

# Fixed code
def __init__(self, settings):
    QMainWindow.__init__(self)

    self.request_mgr = None
    self.cpu_plot = None
    self.memory_plot = None
    self.initialized_cpu_plot = False
    self.initialized_memory_plot = False
    self.cpu_plot_timer = None
    self.memory_plot_timer = None

    uic.loadUi(get_ui_file_path("debugwindow.ui"), self)
    self.setWindowTitle("Tribler debug pane")

    self.window().dump_memory_core_button.clicked.connect(
        lambda: self.on_memory_dump_button_clicked(True)
    )
    self.window().dump_memory_gui_button.clicked.connect(
        lambda: self.on_memory_dump_button_clicked(False)
    )

    self.window().debug_tab_widget.setCurrentIndex(0)
    self.window().dispersy_tab_widget.setCurrentIndex(0)
    self.window().system_tab_widget.setCurrentIndex(0)
    self.window().debug_tab_widget.currentChanged.connect(self.tab_changed)
    self.window().dispersy_tab_widget.currentChanged.connect(self.dispersy_tab_changed)
    self.window().events_tree_widget.itemClicked.connect(self.on_event_clicked)
    self.window().system_tab_widget.currentChanged.connect(self.system_tab_changed)
    self.load_general_tab()

    self.window().open_files_tree_widget.header().setSectionResizeMode(
        0, QHeaderView.Stretch
    )

    if not settings["trustchain"]["enabled"]:
        self.window().debug_tab_widget.setTabEnabled(2, False)

    # Refresh logs
    self.window().log_refresh_button.clicked.connect(lambda: self.load_logs_tab())