Repository: spyder-ide/spyder

Issue:
Facing error when trying to open spyder tutorial
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [x] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [x] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [x] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [x] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [x] Tried basic troubleshooting (if a bug/error)
    * [x] Restarted Spyder
    * [x] Reset preferences with ``spyder --reset``
    * [x] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [x] Tried the other applicable steps from the Troubleshooting Guide
* [x] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
This is the error when trying to open spyder tutorial or getting help for a function in rich text format
![image](https://user-images.githubusercontent.com/58983090/75320673-34f40480-5895-11ea-9804-ecc4dfc16558.png)



### What steps reproduce the problem?

1. When trying to open spyder tutorial 
2. Getting help for a function in rich text format 


### What is the expected output? What do you see instead?



### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->

```python-traceback

PASTE TRACEBACK HERE

```

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 4.0.1
* Python version: 3.7.4
* Qt version: 
* PyQt version: 
* Operating System name/version: Windows 10 home

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```
PASTE DEPENDENCIES HERE
```



Discussion:
@dalthviz, this happens because people install Anaconda in drives different from `C:\`, but try to load the tutorial from `C:\`.
@ccordoba12 I uninstalled anaconda and then reinstalled it in c:\ Now it is working fine Thanks . 
Thanks for letting us know about it! Still, this is an issue we have to solve.

Resolving patch:
diff --git a/spyder/plugins/help/utils/sphinxify.py b/spyder/plugins/help/utils/sphinxify.py
--- a/spyder/plugins/help/utils/sphinxify.py
+++ b/spyder/plugins/help/utils/sphinxify.py
@@ -38,8 +38,13 @@
 # Local imports
 from spyder.config.base import (_, get_module_data_path,
                                 get_module_source_path)
+from spyder.py3compat import PY2
 from spyder.utils import encoding
 
+if PY2:
+    import pathlib2 as pathlib
+else:
+    import pathlib
 
 #-----------------------------------------------------------------------------
 # Globals and constants
@@ -180,9 +185,24 @@ def sphinxify(docstring, context, buildername='html'):
     on the value of `buildername`
     """
 
+    confdir = osp.join(get_module_source_path('spyder.plugins.help.utils'))
     srcdir = mkdtemp()
     srcdir = encoding.to_unicode_from_fs(srcdir)
     destdir = osp.join(srcdir, '_build')
+    temp_confdir_needed = False
+
+    if os.name == 'nt':
+        # Check if confdir and srcdir are in the same drive
+        # See spyder-ide/spyder#11762
+        drive_confdir = pathlib.Path(confdir).parts[0]
+        drive_srcdir = pathlib.Path(srcdir).parts[0]
+        temp_confdir_needed = drive_confdir != drive_srcdir
+
+        if temp_confdir_needed:
+            # TODO: This may be inefficient. Find a faster way to do it.
+            confdir = mkdtemp()
+            confdir = encoding.to_unicode_from_fs(confdir)
+            generate_configuration(confdir)
 
     rst_name = osp.join(srcdir, 'docstring.rst')
     if buildername == 'html':
@@ -214,15 +234,6 @@ def sphinxify(docstring, context, buildername='html'):
     doc_file.write(docstring)
     doc_file.close()
 
-    temp_confdir = False
-    if temp_confdir:
-        # TODO: This may be inefficient. Find a faster way to do it.
-        confdir = mkdtemp()
-        confdir = encoding.to_unicode_from_fs(confdir)
-        generate_configuration(confdir)
-    else:
-        confdir = osp.join(get_module_source_path('spyder.plugins.help.utils'))
-
     confoverrides = {'html_context': context}
 
     doctreedir = osp.join(srcdir, 'doctrees')
@@ -248,7 +259,7 @@ def sphinxify(docstring, context, buildername='html'):
                     "Please see it in plain text.")
         return warning(output)
 
-    if temp_confdir:
+    if temp_confdir_needed:
         shutil.rmtree(confdir, ignore_errors=True)
     shutil.rmtree(srcdir, ignore_errors=True)
 


Test patch: