From 3dadb8989b64ecc9277356c3295953abffee0223 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Fri, 23 Aug 2019 09:43:51 +0100 Subject: [PATCH] Fix a debugger error when using Python 2.7. Fixes #4419 Also fixes a minor bug where a reload warning was unnecessarily given when closing the debugger. --- docs/en_US/release_notes_4_13.rst | 1 + web/pgadmin/tools/debugger/static/js/direct.js | 3 +-- web/pgadmin/tools/debugger/utils/debugger_instance.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en_US/release_notes_4_13.rst b/docs/en_US/release_notes_4_13.rst index bc21dfeca..a009ef4e8 100644 --- a/docs/en_US/release_notes_4_13.rst +++ b/docs/en_US/release_notes_4_13.rst @@ -21,6 +21,7 @@ Bug fixes | `Issue #2706 `_ - Added ProjectSet icon for explain module. | `Issue #2828 `_ - Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module. +| `Issue #4419 `_ - Fix a debugger error when using Python 2.7. | `Issue #4643 `_ - Fix Truncate option deselect issue for compound triggers. | `Issue #4644 `_ - Fix length and precision enable/disable issue when changing the data type for Domain node. | `Issue #4650 `_ - Fix SQL tab issue for Views. It's a regression of compound triggers. \ No newline at end of file diff --git a/web/pgadmin/tools/debugger/static/js/direct.js b/web/pgadmin/tools/debugger/static/js/direct.js index fab16604a..123b9cf10 100644 --- a/web/pgadmin/tools/debugger/static/js/direct.js +++ b/web/pgadmin/tools/debugger/static/js/direct.js @@ -1541,8 +1541,6 @@ define([ }); this.panels = []; - pgBrowser.bind_beforeunload(); - // Below code will be executed for indirect debugging // indirect debugging - 0 and for direct debugging - 1 if (trans_id != undefined && !debug_type) { @@ -1853,6 +1851,7 @@ define([ * instead, a poller is set up who will check */ if(self.preferences.debugger_new_browser_tab) { + pgBrowser.bind_beforeunload(); let pollIntervalId = setInterval(()=>{ if(window.opener && window.opener.pgAdmin) { self.reflectPreferences(); diff --git a/web/pgadmin/tools/debugger/utils/debugger_instance.py b/web/pgadmin/tools/debugger/utils/debugger_instance.py index 82d79f6ec..66393801b 100644 --- a/web/pgadmin/tools/debugger/utils/debugger_instance.py +++ b/web/pgadmin/tools/debugger/utils/debugger_instance.py @@ -14,12 +14,12 @@ import random debugger_sessions_lock = Lock() -class DebuggerInstance: +class DebuggerInstance(object): def __init__(self, trans_id=None): if trans_id is None: self._trans_id = str(random.randint(1, 9999999)) else: - self._trans_id = trans_id + self._trans_id = str(trans_id) self._function_data = None self._debugger_data = None