prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  python without debugging won't start if there is a breakpoint
  @tmdag commented on [Thu May 02 2019](https://github.com/microsoft/vscode-python/issues/5540)
  
  ## Environment data
  - VSCode Version: 1.33.1
  - OS Version:Linux 5.0.7-200.fc29.x86_64
  - Extension version (available under the Extensions sidebar): Python 2019.4.11987
  - Anaconda Extension Pack 1.0.1
  
  ## Steps to reproduce:
  Open Python code
  create a breakpoint
  run python without debugging (ctrl+F5)
  Terminal output:
  
  cd /home/user/dev/Pytool ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 /usr/bin/python3 /home/user/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/ptvsd_launcher.py --default --nodebug --client --host localhost --port 36019 /home/user/dev/Pytool/mypytool.py
  Terminated
  Does this issue occur when all extensions are disabled?: Yes/No
  Not sure - Python extension is required
  
  ## Enabled Extensions:
  Bookmarks 10.4.3
  C/C++ 0.221
  Gist 3.0.3
  Git History 0.4.6
  GitLens - 9.6.3
  markdownlint 0.26.0
  
  Syncing 2.1.6
  OpenCL 0.5.2
  VEX 0.4.0
  TAML 0.4.0
  
  
  
  ---
  
  @jxramos commented on [Thu May 02 2019](https://github.com/microsoft/vscode-python/issues/5540#issuecomment-488807421)
  
  I'm seeing this too on a MacOS, it immediately exits with `Terminated: 15`. This behavior persists even if the breakpoint is disabled/unchecked.
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/ptvsd/runner.py`
  Content:
  ```
  1 # Copyright (c) Microsoft Corporation. All rights reserved.
  2 # Licensed under the MIT License. See LICENSE in the project root
  3 # for license information.
  4 
  5 import pydevd
  6 import threading
  7 
  8 from ptvsd.daemon import DaemonBase
  9 from ptvsd.session import DebugSession
  10 from ptvsd.wrapper import VSCLifecycleMsgProcessor
  11 from pydevd import init_stdout_redirect, init_stderr_redirect
  12 
  13 
  14 HOSTNAME = 'localhost'
  15 
  16 
  17 def run(address, filename, is_module, *args, **kwargs):
  18     # TODO: docstring
  19     # TODO: client/server -> address
  20     daemon = Daemon()
  21     if not daemon.wait_for_launch(address):
  22         return
  23 
  24     debugger = pydevd.PyDB()
  25     # We do not want some internal methods to get executed in non-debug mode.
  26     debugger.init_matplotlib_support = lambda *arg: None
  27     debugger.run(
  28         file=filename,
  29         globals=None,
  30         locals=None,
  31         is_module=is_module,
  32         set_trace=False)
  33 
  34 
  35 class Daemon(DaemonBase):
  36     """The process-level manager for the VSC protocol debug adapter."""
  37 
  38     LAUNCH_TIMEOUT = 10000  # seconds
  39 
  40     class SESSION(DebugSession):
  41         class MESSAGE_PROCESSOR(VSCLifecycleMsgProcessor):
  42             def on_invalid_request(self, request, args):
  43                 self.send_response(request, success=True)
  44 
  45     def wait_for_launch(self, addr, timeout=LAUNCH_TIMEOUT):
  46         # TODO: docstring
  47         launched = threading.Event()
  48         _, start_session = self.start_client(addr)
  49         start_session(
  50             notify_launch=launched.set,
  51         )
  52         return launched.wait(timeout)
  53 
  54     def _start(self):
  55         import weakref
  56         weak_self = weakref.ref(self)  # Avoid cyclic ref
  57 
  58         def on_stdout(msg):
  59             self = weak_self()
  60             if self is not None:
  61                 self._send_output('stdout', msg)
  62 
  63         def on_stderr(msg):
  64             self = weak_self()
  65             if self is not None:
  66                 self._send_output('stderr', msg)
  67 
  68         init_stdout_redirect(on_stdout)
  69         init_stderr_redirect(on_stderr)
  70         return NoSocket()
  71 
  72     def _close(self):
  73         super(Daemon, self)._close()
  74 
  75     def _send_output(self, category, output):
  76         if self.session is None:
  77             return
  78         self.session._msgprocessor.send_event('output',
  79                                               category=category,
  80                                               output=output)
  81 
  82 
  83 class NoSocket(object):
  84     """A object with a noop socket lifecycle."""
  85 
  86     def shutdown(self, *args, **kwargs):
  87         pass
  88 
  89     def close(self):
  90         pass
  91
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/ptvsd/runner.py b/src/ptvsd/runner.py
  --- a/src/ptvsd/runner.py
  +++ b/src/ptvsd/runner.py
  @@ -39,6 +39,19 @@
   
       class SESSION(DebugSession):
           class MESSAGE_PROCESSOR(VSCLifecycleMsgProcessor):
  +
  +            def on_setBreakpoints(self, request, args):
  +                # Note: breakpoints is required (vscode will terminate
  +                # the debugger if that's not the case).
  +                # See: https://github.com/microsoft/ptvsd/issues/1408
  +                self.send_response(
  +                    request,
  +                    success=True,
  +                    breakpoints=(
  +                        [{'verified': False}] * len(args.get('breakpoints', ()))
  +                    )
  +                )
  +
               def on_invalid_request(self, request, args):
                   self.send_response(request, success=True)
  
verification_info: {"golden_diff": "diff --git a/src/ptvsd/runner.py b/src/ptvsd/runner.py\n--- a/src/ptvsd/runner.py\n+++ b/src/ptvsd/runner.py\n@@ -39,6 +39,19 @@\n \n     class SESSION(DebugSession):\n         class MESSAGE_PROCESSOR(VSCLifecycleMsgProcessor):\n+\n+            def on_setBreakpoints(self, request, args):\n+                # Note: breakpoints is required (vscode will terminate\n+                # the debugger if that's not the case).\n+                # See: https://github.com/microsoft/ptvsd/issues/1408\n+                self.send_response(\n+                    request,\n+                    success=True,\n+                    breakpoints=(\n+                        [{'verified': False}] * len(args.get('breakpoints', ()))\n+                    )\n+                )\n+\n             def on_invalid_request(self, request, args):\n                 self.send_response(request, success=True)\n", "issue": "python without debugging won't start if there is a breakpoint\n@tmdag commented on [Thu May 02 2019](https://github.com/microsoft/vscode-python/issues/5540)\n\n## Environment data\r\n- VSCode Version: 1.33.1\r\n- OS Version:Linux 5.0.7-200.fc29.x86_64\r\n- Extension version (available under the Extensions sidebar): Python 2019.4.11987\r\n- Anaconda Extension Pack 1.0.1\r\n\r\n## Steps to reproduce:\r\nOpen Python code\r\ncreate a breakpoint\r\nrun python without debugging (ctrl+F5)\r\nTerminal output:\r\n\r\ncd /home/user/dev/Pytool ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 /usr/bin/python3 /home/user/.vscode/extensions/ms-python.python-2019.4.11987/pythonFiles/ptvsd_launcher.py --default --nodebug --client --host localhost --port 36019 /home/user/dev/Pytool/mypytool.py\r\nTerminated\r\nDoes this issue occur when all extensions are disabled?: Yes/No\r\nNot sure - Python extension is required\r\n\r\n## Enabled Extensions:\r\nBookmarks 10.4.3\r\nC/C++ 0.221\r\nGist 3.0.3\r\nGit History 0.4.6\r\nGitLens - 9.6.3\r\nmarkdownlint 0.26.0\r\n\r\nSyncing 2.1.6\r\nOpenCL 0.5.2\r\nVEX 0.4.0\r\nTAML 0.4.0\r\n\r\n\n\n---\n\n@jxramos commented on [Thu May 02 2019](https://github.com/microsoft/vscode-python/issues/5540#issuecomment-488807421)\n\nI'm seeing this too on a MacOS, it immediately exits with `Terminated: 15`. This behavior persists even if the breakpoint is disabled/unchecked.\n\n\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See LICENSE in the project root\n# for license information.\n\nimport pydevd\nimport threading\n\nfrom ptvsd.daemon import DaemonBase\nfrom ptvsd.session import DebugSession\nfrom ptvsd.wrapper import VSCLifecycleMsgProcessor\nfrom pydevd import init_stdout_redirect, init_stderr_redirect\n\n\nHOSTNAME = 'localhost'\n\n\ndef run(address, filename, is_module, *args, **kwargs):\n    # TODO: docstring\n    # TODO: client/server -> address\n    daemon = Daemon()\n    if not daemon.wait_for_launch(address):\n        return\n\n    debugger = pydevd.PyDB()\n    # We do not want some internal methods to get executed in non-debug mode.\n    debugger.init_matplotlib_support = lambda *arg: None\n    debugger.run(\n        file=filename,\n        globals=None,\n        locals=None,\n        is_module=is_module,\n        set_trace=False)\n\n\nclass Daemon(DaemonBase):\n    \"\"\"The process-level manager for the VSC protocol debug adapter.\"\"\"\n\n    LAUNCH_TIMEOUT = 10000  # seconds\n\n    class SESSION(DebugSession):\n        class MESSAGE_PROCESSOR(VSCLifecycleMsgProcessor):\n            def on_invalid_request(self, request, args):\n                self.send_response(request, success=True)\n\n    def wait_for_launch(self, addr, timeout=LAUNCH_TIMEOUT):\n        # TODO: docstring\n        launched = threading.Event()\n        _, start_session = self.start_client(addr)\n        start_session(\n            notify_launch=launched.set,\n        )\n        return launched.wait(timeout)\n\n    def _start(self):\n        import weakref\n        weak_self = weakref.ref(self)  # Avoid cyclic ref\n\n        def on_stdout(msg):\n            self = weak_self()\n            if self is not None:\n                self._send_output('stdout', msg)\n\n        def on_stderr(msg):\n            self = weak_self()\n            if self is not None:\n                self._send_output('stderr', msg)\n\n        init_stdout_redirect(on_stdout)\n        init_stderr_redirect(on_stderr)\n        return NoSocket()\n\n    def _close(self):\n        super(Daemon, self)._close()\n\n    def _send_output(self, category, output):\n        if self.session is None:\n            return\n        self.session._msgprocessor.send_event('output',\n                                              category=category,\n                                              output=output)\n\n\nclass NoSocket(object):\n    \"\"\"A object with a noop socket lifecycle.\"\"\"\n\n    def shutdown(self, *args, **kwargs):\n        pass\n\n    def close(self):\n        pass\n", "path": "src/ptvsd/runner.py"}], "after_files": [{"content": "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See LICENSE in the project root\n# for license information.\n\nimport pydevd\nimport threading\n\nfrom ptvsd.daemon import DaemonBase\nfrom ptvsd.session import DebugSession\nfrom ptvsd.wrapper import VSCLifecycleMsgProcessor\nfrom pydevd import init_stdout_redirect, init_stderr_redirect\n\n\nHOSTNAME = 'localhost'\n\n\ndef run(address, filename, is_module, *args, **kwargs):\n    # TODO: docstring\n    # TODO: client/server -> address\n    daemon = Daemon()\n    if not daemon.wait_for_launch(address):\n        return\n\n    debugger = pydevd.PyDB()\n    # We do not want some internal methods to get executed in non-debug mode.\n    debugger.init_matplotlib_support = lambda *arg: None\n    debugger.run(\n        file=filename,\n        globals=None,\n        locals=None,\n        is_module=is_module,\n        set_trace=False)\n\n\nclass Daemon(DaemonBase):\n    \"\"\"The process-level manager for the VSC protocol debug adapter.\"\"\"\n\n    LAUNCH_TIMEOUT = 10000  # seconds\n\n    class SESSION(DebugSession):\n        class MESSAGE_PROCESSOR(VSCLifecycleMsgProcessor):\n\n            def on_setBreakpoints(self, request, args):\n                # Note: breakpoints is required (vscode will terminate\n                # the debugger if that's not the case).\n                # See: https://github.com/microsoft/ptvsd/issues/1408\n                self.send_response(\n                    request,\n                    success=True,\n                    breakpoints=(\n                        [{'verified': False}] * len(args.get('breakpoints', ()))\n                    )\n                )\n\n            def on_invalid_request(self, request, args):\n                self.send_response(request, success=True)\n\n    def wait_for_launch(self, addr, timeout=LAUNCH_TIMEOUT):\n        # TODO: docstring\n        launched = threading.Event()\n        _, start_session = self.start_client(addr)\n        start_session(\n            notify_launch=launched.set,\n        )\n        return launched.wait(timeout)\n\n    def _start(self):\n        import weakref\n        weak_self = weakref.ref(self)  # Avoid cyclic ref\n\n        def on_stdout(msg):\n            self = weak_self()\n            if self is not None:\n                self._send_output('stdout', msg)\n\n        def on_stderr(msg):\n            self = weak_self()\n            if self is not None:\n                self._send_output('stderr', msg)\n\n        init_stdout_redirect(on_stdout)\n        init_stderr_redirect(on_stderr)\n        return NoSocket()\n\n    def _close(self):\n        super(Daemon, self)._close()\n\n    def _send_output(self, category, output):\n        if self.session is None:\n            return\n        self.session._msgprocessor.send_event('output',\n                                              category=category,\n                                              output=output)\n\n\nclass NoSocket(object):\n    \"\"\"A object with a noop socket lifecycle.\"\"\"\n\n    def shutdown(self, *args, **kwargs):\n        pass\n\n    def close(self):\n        pass\n", "path": "src/ptvsd/runner.py"}]}