Repository: spyder-ide/spyder

Issue:
TypeError when opening a project
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

While in a project opened at Spyder start-up I try to click Projects->Open Project and I receive this error

### Traceback
```python-traceback
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\projects\plugin.py", line 98, in <lambda>
    triggered=lambda v: self.open_project())
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\projects\plugin.py", line 288, in open_project
    self.notify_project_open(path)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\decorators.py", line 22, in wrapper
    self.emit_request(method, params, requires_response)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\projects\plugin.py", line 553, in emit_request
    self.main.completions.broadcast_notification(method, params)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\plugin.py", line 323, in broadcast_notification
    req_type, req)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\languageserver\plugin.py", line 578, in broadcast_notification
    self.send_notification(language, request, params)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\languageserver\plugin.py", line 569, in send_notification
    client.perform_request(request, params)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\languageserver\client.py", line 527, in perform_request
    _id = handler(params)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\languageserver\decorators.py", line 41, in wrapper
    params = req(self, *args, **kwargs)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\languageserver\providers\workspace.py", line 46, in send_workspace_folders_change
    folder_uri = path_as_uri(folder)
  File "C:\anaconda3\envs\tf20\lib\site-packages\spyder\plugins\completion\languageserver\providers\utils.py", line 51, in path_as_uri
    path_obj = pathlib.Path(osp.abspath(path))
  File "C:\anaconda3\envs\tf20\lib\ntpath.py", line 526, in abspath
    return normpath(_getfullpathname(path))
TypeError: _getfullpathname: path should be string, bytes or os.PathLike, not NoneType
```

## Versions

* Spyder version: 4.1.4 
* Python version: 3.7.7
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 10

### Dependencies

```

# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.5.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.16.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=1.0                   :  2.5.3 (OK)
pyls >=0.34.0;<1.0.0           :  0.34.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.5 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.1.2 (OK)
spyder_kernels >=1.9.2;<1.10.0 :  1.9.2 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  19.0.1 (OK)

# Optional:
cython >=0.21                  :  0.29.21 (OK)
matplotlib >=2.0.0             :  3.2.2 (OK)
numpy >=1.7                    :  1.18.5 (OK)
pandas >=0.13.1                :  1.0.5 (OK)
scipy >=0.17.0                 :  1.5.0 (OK)
sympy >=0.7.3                  :  1.6.1 (OK)
```



Discussion:
I have the same issues. After reverting back to 4.1.3, I can open project again. So, it should be something wrong with 4.1.4.
I can't reproduce this on Linux. @dalthviz, could you try it on Windows?
I was unable to reproduce this, however seems like some how the empty path send when calling the open action is being use to respond to the notification of the workspace change, maybe @andfoy could have an idea of what this could be happening? (maybe is some sort of race condition?)

Also, seems like this a duplicate of #13338 and #12967 . In the case of #13338 a restart helped
Thanks @dalthviz for the feedback. I have two comments about this:

1. Issue #12967 shows that the problem was present before 4.1.4.
2. Although we can't reproduce this on our side, the solution is simply validating that the project's path is not None when trying to open a project.
Just in case, I was able to reproduce this: 

![p](https://user-images.githubusercontent.com/16781833/88324035-b8047400-cce8-11ea-9baf-61a362477f00.gif)


Resolving patch:
diff --git a/spyder/plugins/projects/plugin.py b/spyder/plugins/projects/plugin.py
--- a/spyder/plugins/projects/plugin.py
+++ b/spyder/plugins/projects/plugin.py
@@ -285,7 +285,6 @@ def _create_project(self, path):
     def open_project(self, path=None, restart_consoles=True,
                      save_previous_files=True):
         """Open the project located in `path`"""
-        self.notify_project_open(path)
         self.unmaximize()
         if path is None:
             basedir = get_home_dir()
@@ -300,7 +299,6 @@ def open_project(self, path=None, restart_consoles=True,
                 return
         else:
             path = encoding.to_unicode_from_fs(path)
-
         self.add_to_recent(path)
 
         # A project was not open before
@@ -326,6 +324,7 @@ def open_project(self, path=None, restart_consoles=True,
         project = EmptyProject(path)
         self.current_active_project = project
         self.latest_project = project
+        self.notify_project_open(path)
         self.set_option('current_project_path', self.get_active_project_path())
 
         self.setup_menu_actions()


Test patch: