Repository: microsoft/ptvsd

Issue:
Debugger raising IndexError
Microsoft/vscode-python#2499

```
PS C:\Users\Hugh.Groves> cd '\\global.arup.com\americas\Jobs\STJ\230000\230597-00(ACDO)\4-04 Engineering\4-04-02 Concrete\02 Calculations\19 Staged Construction\99-Tools\CreateBatches'; ${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFNIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; ${env:PYTHONPATH}='c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd'; & 'C:\Users\Hugh.Groves\AppDthon.exe' '-m' 'ptvsd' '--host' 'localhoata\Local\Continuum\Anaconda3\envs\p3\python.exe' '-m' 'ptvsd' '--host' 'localhost' '--port' '53026' '\\global.arup.com\americas\Jobs\STJ\230000\230597-00(ACDO)\4-04 Engineering\4-04-02 Concrete\02 Calculations\19 Staged Construction\99-Tools\CreateBatches\CreateBatches_02.py'
Traceback (most recent call last):
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1254, in done
    fut.result()
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 40, in result
    reraise(self._exc_info)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\reraise3.py", line 8, in reraise
    raise exc_info[1].with_traceback(exc_info[2])
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 155, in callback
    x = it.send(fut.result())
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1605, in on_stackTrace
    norm_path = self.path_casing.un_normcase(unquote(str(xframe['file'])))  # noqa
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 30, in un_normcase
    file_path_to_return = self._get_actual_filename(file_path)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 60, in _get_actual_filename
    fragments += ["{}[{}]".format(d[:-1], d[-1])]
IndexError: string index out of range
Traceback (most recent call last):
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1254, in donetal\ptvsd\ptvsd\wrapper.py", line 1254, in done
    fut.result()                                                                               tal\ptvsd\ptvsd\futures.py", line 40, in result
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 40, in result                                                tal\ptvsd\ptvsd\reraise3.py", line 8, in reraise
    reraise(self._exc_info)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 155, in callbacktal\ptvsd\ptvsd\reraise3.py", line 8, in reraise
    raise exc_info[1].with_traceback(exc_info[2])
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\futures.py", line 155, in callback    x = it.send(fut.result())
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\wrapper.py", line 1605, in on_stackTrace
    norm_path = self.path_casing.un_normcase(unquote(str(xframe['file'])))  # noqa  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 30, in un_normcase
    file_path_to_return = self._get_actual_filename(file_path)
  File "c:\Users\Hugh.Groves\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\pathutils.py", line 60, in _get_actual_filename    fragments += ["{}[{}]".format(d[:-1], d[-1])]
IndexError: string index out of range
```


Discussion:
Changing priority as users are able to use the debugger in some cases.
Is there any detail on the folder structure where this occurs? 
No
Regarding the folder structure, this issue occurs when the filepath of the .py being debugged is on a network drive (e.g. ‘\\\global.arup.com’).

Resolving patch:
diff --git a/ptvsd/pathutils.py b/ptvsd/pathutils.py
--- a/ptvsd/pathutils.py
+++ b/ptvsd/pathutils.py
@@ -56,8 +56,7 @@ def _get_actual_filename(self, name):
             dir_names = os.listdir(os.getcwd())
             fragments = list(filter(
                             lambda x: x.upper() == path_fragment1, dir_names))
-        for d in dirs[1:]:
-            fragments += ["{}[{}]".format(d[:-1], d[-1])]
+        fragments += list(d for d in dirs[1:] if d)
         path = glob(sep.join(fragments))
         if not path:
             return name


Test patch: