internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spyder-ide/spyder

Issue:
Toggle uppercase/lowercase menu icons
## Problem Description

I just saw that the `Toggle Uppercase` and `Toggle Lowercase` actions were added to the `Edit` menu in Spyder4. Good idea and thank you for that.

I suggest that we use these two icons from mdi qtawesome for these actions so it looks even better. What do you think?

![image](https://user-images.githubusercontent.com/10170372/58968892-cb6f1b80-8784-11e9-8d20-a92830cf06f1.png)


Discussion:
@jnsebgosselin sounds like a great idea. Want to make a PR :-) ?

> @jnsebgosselin sounds like a great idea. Want to make a PR :-) ?

Of course, I was just waiting for the green light hehe! :)
+1 from me too.

Resolving patch:
diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py
--- a/spyder/plugins/editor/plugin.py
+++ b/spyder/plugins/editor/plugin.py
@@ -739,14 +739,14 @@ def get_plugin_actions(self):
                 triggered=self.unindent, context=Qt.WidgetShortcut)
 
         self.text_uppercase_action = create_action(self,
-                _("Toggle Uppercase"),
+                _("Toggle Uppercase"), icon=ima.icon('toggle_uppercase'),
                 tip=_("Change to uppercase current line or selection"),
                 triggered=self.text_uppercase, context=Qt.WidgetShortcut)
         self.register_shortcut(self.text_uppercase_action, context="Editor",
                                name="transform to uppercase")
 
         self.text_lowercase_action = create_action(self,
-                _("Toggle Lowercase"),
+                _("Toggle Lowercase"), icon=ima.icon('toggle_lowercase'),
                 tip=_("Change to lowercase current line or selection"),
                 triggered=self.text_lowercase, context=Qt.WidgetShortcut)
         self.register_shortcut(self.text_lowercase_action, context="Editor",
diff --git a/spyder/utils/icon_manager.py b/spyder/utils/icon_manager.py
--- a/spyder/utils/icon_manager.py
+++ b/spyder/utils/icon_manager.py
@@ -160,6 +160,8 @@
     'comment':                 [('fa.comment',), {'color': MAIN_FG_COLOR}],
     'indent':                  [('fa.indent',), {'color': MAIN_FG_COLOR}],
     'unindent':                [('fa.outdent',), {'color': MAIN_FG_COLOR}],
+    'toggle_lowercase':        [('mdi.format-letter-case-lower',), {'color': MAIN_FG_COLOR}],
+    'toggle_uppercase':        [('mdi.format-letter-case-upper',), {'color': MAIN_FG_COLOR}],
     'gotoline':                [('fa.sort-numeric-asc',), {'color': MAIN_FG_COLOR}],
     'error':                   [('fa.times-circle',), {'color': 'darkred'}],
     'warning':                 [('fa.warning',), {'color': 'orange'}],


Test patch:
Repository: spyder-ide/spyder

Issue:
EditorStack file and symbol switcher not working
## Problem Description



### What steps reproduce the problem?

Click on `File switcher...` or ` Find symbol in file...` of an editorstack menu. 

![image](https://user-images.githubusercontent.com/10170372/58609863-444b1080-8277-11e9-851d-4f7475b2f938.png)
 

### Paste Traceback/Error Below (if applicable)

```python-traceback
  File "C:\Users\User\spyder\spyder\plugins\editor\widgets\editor.py", line 858, in open_fileswitcher_dlg
    self.fileswitcher_dlg.show()
  File "C:\Users\User\spyder\spyder\widgets\fileswitcher.py", line 907, in show
    self.setup()
  File "C:\Users\User\spyder\spyder\widgets\fileswitcher.py", line 897, in setup
    self.setup_file_list(filter_text, current_path)
  File "C:\Users\User\spyder\spyder\widgets\fileswitcher.py", line 752, in setup_file_list
    title = self.widgets[index][1].get_plugin_title().split(
AttributeError: 'EditorStack' object has no attribute 'get_plugin_title'
```

## 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: Spyder 4.0.0.dev0 (Commit: b6a358702) 
* Python version: Python 3.7.1 64-bit
* Qt version: Qt 5.9.6
* PyQt version: PyQt5 5.9.2
* Operating System name/version: Windows 10


Discussion:
@dalthviz, please take a look at this one. It seems an easy fix.

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py
--- a/spyder/plugins/editor/widgets/editor.py
+++ b/spyder/plugins/editor/widgets/editor.py
@@ -863,6 +863,12 @@ def open_symbolfinder_dlg(self):
         self.open_fileswitcher_dlg()
         self.fileswitcher_dlg.set_search_text('@')
 
+    def get_plugin_title(self):
+        """Get the plugin title of the parent widget."""
+        # Needed for the editor stack to use its own fileswitcher instance.
+        # See spyder-ide/spyder#9469
+        return self.parent().plugin.get_plugin_title()
+
     def get_current_tab_manager(self):
         """Get the widget with the TabWidget attribute."""
         return self


Test patch:
Repository: spyder-ide/spyder

Issue:
Restore underlining errors and warnings in the Editor
Add additional highlights to the code editor words to indicate the problems (errors, warning, info, hint) on the text itself, using curly underline and colors

<img width="439" alt="Screen Shot 2019-05-29 at 19 15 33" src="https://user-images.githubusercontent.com/3627835/58599500-2b763700-8246-11e9-8cf2-b17ba8a80cba.png">

<img width="748" alt="Screen Shot 2019-05-29 at 19 20 58" src="https://user-images.githubusercontent.com/3627835/58599686-f61e1900-8246-11e9-8347-477e4220d671.png">



Discussion:
@steff456, please work on this one. The idea is to underline the parts of a line where there are errors/warnings/hints reported by the PyLS.

This was working in Spyder 3, so please take a look at

https://github.com/spyder-ide/spyder/blob/3.x/spyder/widgets/sourcecode/codeeditor.py

and look for `underline` there.

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py
--- a/spyder/plugins/editor/widgets/codeeditor.py
+++ b/spyder/plugins/editor/widgets/codeeditor.py
@@ -1470,7 +1470,7 @@ def __clear_occurrences(self):
     def __highlight_selection(self, key, cursor, foreground_color=None,
                         background_color=None, underline_color=None,
                         outline_color=None,
-                        underline_style=QTextCharFormat.WaveUnderline,
+                        underline_style=QTextCharFormat.SingleUnderline,
                         update=False):
         if cursor is None:
             return
@@ -1941,7 +1941,7 @@ def process_code_analysis(self, results):
                 QTextCursor.NextCharacter, n=end['character'],
                 mode=QTextCursor.KeepAnchor)
             color = QColor(color)
-            color.setAlpha(50)
+            color.setAlpha(255)
 
             data = block.userData()
             if not data:
@@ -1951,6 +1951,8 @@ def process_code_analysis(self, results):
             block.setUserData(data)
             block.selection = QTextCursor(cursor)
             block.color = color
+            self.__highlight_selection('code_analysis', block.selection,
+                                       underline_color=block.color)
 
         self.sig_process_code_analysis.emit()
         self.update_extra_selections()


Test patch:
Repository: spyder-ide/spyder

Issue:
ValueError when clicking on a traceback link in the IPython console
## Description

### What steps will reproduce the problem?

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

what is the problem????invalid token?
i hope problem solve soon;thanks!

### Traceback
```python-traceback
  File "C:\Users\lenovo\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1679, in go_to_error
    self.edit_goto.emit(osp.abspath(fname), int(lnb), '')
ValueError: invalid literal for int() with base 10: ''
```

## Versions

* Spyder version: 3.3.3 
* Python version: 3.6.3
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 10

### Dependencies

```
pyflakes >=0.6.0  :  1.6.0 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)
pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  1.6.3 (OK)
rope >=0.9.4      :  0.10.5 (OK)
jedi >=0.9.0      :  0.10.2 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
pandas >=0.13.1   :  0.20.3 (OK)
numpy >=1.7       :  1.16.3 (OK)
sympy >=0.7.3     :  1.1.1 (OK)
cython >=0.21     :  0.26.1 (OK)
qtconsole >=4.2.0 :  4.3.1 (OK)
IPython >=4.0     :  6.1.0 (OK)
matplotlib >=2.0.0:  3.0.3 (OK)
pylint >=0.25     :  1.7.4 (OK)
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py
--- a/spyder/plugins/ipythonconsole.py
+++ b/spyder/plugins/ipythonconsole.py
@@ -1694,7 +1694,11 @@ def go_to_error(self, text):
         match = get_error_match(to_text_string(text))
         if match:
             fname, lnb = match.groups()
-            self.edit_goto.emit(osp.abspath(fname), int(lnb), '')
+            # This is needed to fix issue spyder-ide/spyder#9217
+            try:
+                self.edit_goto.emit(osp.abspath(fname), int(lnb), '')
+            except ValueError:
+                pass
 
     @Slot()
     def show_intro(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
TypeError: cursor_position_changed
## Description

### What steps will reproduce the problem?

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

typing `(` without closing `)` and then moving the cursor.

### Traceback
```python-traceback
  File "/Users/kareem/miniconda3/envs/data_science/lib/python3.5/site-packages/spyder/widgets/calltip.py", line 117, in hideEvent
    self._cursor_position_changed)
TypeError: 'method' object is not connected
```

## Versions

* Spyder version: 3.3.1 
* Python version: 3.5.5
* Qt version: 5.12.2
* PyQt5 version: 5.12.1
* Operating System: Darwin 18.5.0

### Dependencies

```
pyflakes >=0.6.0  :  2.1.1 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pygments >=2.0    :  2.3.1 (OK)
sphinx >=0.6.6    :  2.0.1 (OK)
rope >=0.9.4      :  0.14.0 (OK)
jedi >=0.9.0      :  0.12.1 (OK)
psutil >=0.3      :  5.4.7 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
numpy >=1.7       :  1.14.3 (OK)
sympy >=0.7.3     :  None (NOK)
cython >=0.21     :  None (NOK)
qtconsole >=4.2.0 :  4.4.3 (OK)
IPython >=4.0     :  7.0.1 (OK)
matplotlib >=2.0.0:  3.0.0 (OK)
pylint >=0.25     :  2.1.1 (OK)
```



Discussion:
@kareemjeiroudi thanks for reporting!
@goanpeca However, I have to add that this bug has never occurred to me before, and therefore I'm not sure if it's that easily reproducible, but I tried to recall the last action I made before the pop up appeared.

Resolving patch:
diff --git a/spyder/widgets/calltip.py b/spyder/widgets/calltip.py
--- a/spyder/widgets/calltip.py
+++ b/spyder/widgets/calltip.py
@@ -118,8 +118,12 @@ def hideEvent(self, event):
         """ Reimplemented to disconnect signal handlers and event filter.
         """
         super(CallTipWidget, self).hideEvent(event)
-        self._text_edit.cursorPositionChanged.disconnect(
-            self._cursor_position_changed)
+        # This is needed for issue spyder-ide/spyder#9221
+        try:
+            self._text_edit.cursorPositionChanged.disconnect(
+                self._cursor_position_changed)
+        except TypeError:
+            pass
         self._text_edit.removeEventFilter(self)
 
     def leaveEvent(self, event):


Test patch:
Repository: spyder-ide/spyder

Issue:
PermissionError when trying to load a kernel connection file
## Description

### What steps will reproduce the problem?

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

I am unable to connect to remote host from spyder. Comment will be important if someone know how to connect?

### Traceback
```python-traceback
  File "D:\Documents\MasterHZAU2017-2020\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1124, in create_client_for_kernel
    password)
  File "D:\Documents\MasterHZAU2017-2020\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1811, in _create_client_for_kernel
    kernel_client.load_connection_file()
  File "D:\Documents\MasterHZAU2017-2020\Anaconda3\lib\site-packages\jupyter_client\connect.py", line 493, in load_connection_file
    with open(connection_file) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Abdul Saboor Khan\\AnacondaProjects'
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://developer.github.com/v3'}}
```

## Versions

* Spyder version: 3.3.4 
* Python version: 3.6.8
* Qt version: 5.6.2
* PyQt5 version: 5.6
* Operating System: Windows 10

### Dependencies

```
pyflakes >=0.6.0  :  1.5.0 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  1.5.6 (OK)
rope >=0.9.4      :  0.14.0 (OK)
jedi >=0.9.0      :  0.10.2 (OK)
nbconvert >=4.0   :  5.1.1 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
numpy >=1.7       :  1.16.3 (OK)
sympy >=0.7.3     :  1.0 (OK)
cython >=0.21     :  0.25.2 (OK)
qtconsole >=4.2.0 :  4.3.0 (OK)
IPython >=4.0     :  5.3.0 (OK)
matplotlib >=2.0.0:  2.2.2 (OK)
pylint >=0.25     :  1.6.4 (OK)
```



Discussion:
> PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Abdul Saboor Khan\\AnacondaProjects'

It seems you're trying to load a file from a directory you don't have access to. You need to fix that in your side because there's nothing we can do about it other than displaying an error message.

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py
--- a/spyder/plugins/ipythonconsole.py
+++ b/spyder/plugins/ipythonconsole.py
@@ -1819,7 +1819,17 @@ def _create_client_for_kernel(self, connection_file, hostname, sshkey,
 
         # Create kernel client
         kernel_client = QtKernelClient(connection_file=connection_file)
-        kernel_client.load_connection_file()
+
+        # This is needed for issue spyder-ide/spyder#9304
+        try:
+            kernel_client.load_connection_file()
+        except Exception as e:
+            QMessageBox.critical(self, _('Connection error'),
+                                 _("An error occurred while trying to load "
+                                   "the kernel connection file. The error "
+                                   "was:\n\n") + to_text_string(e))
+            return
+
         if hostname is not None:
             try:
                 connection_info = dict(ip = kernel_client.ip,


Test patch:
Repository: spyder-ide/spyder

Issue:
Prevent LSP client to listen to external hosts
In the same spirit of PR #9718, we need to prevent our new LSP client to listen to external hosts.

@steff456, the fix should be as simple as in that PR, but applied to `spyder/plugins/languageserver/client.py`.


Discussion:

Resolving patch:
diff --git a/spyder/plugins/languageserver/client.py b/spyder/plugins/languageserver/client.py
--- a/spyder/plugins/languageserver/client.py
+++ b/spyder/plugins/languageserver/client.py
@@ -47,6 +47,7 @@
                                  osp.dirname(__file__)))
 PENDING = 'pending'
 SERVER_READY = 'server_ready'
+LOCALHOST = '127.0.0.1'
 
 
 logger = logging.getLogger(__name__)
@@ -128,10 +129,12 @@ def __init__(self, parent,
 
     def start(self):
         self.zmq_out_socket = self.context.socket(zmq.PAIR)
-        self.zmq_out_port = self.zmq_out_socket.bind_to_random_port('tcp://*')
+        self.zmq_out_port = self.zmq_out_socket.bind_to_random_port(
+            'tcp://{}'.format(LOCALHOST))
         self.zmq_in_socket = self.context.socket(zmq.PAIR)
         self.zmq_in_socket.set_hwm(0)
-        self.zmq_in_port = self.zmq_in_socket.bind_to_random_port('tcp://*')
+        self.zmq_in_port = self.zmq_in_socket.bind_to_random_port(
+            'tcp://{}'.format(LOCALHOST))
         self.transport_args += ['--zmq-in-port', self.zmq_out_port,
                                 '--zmq-out-port', self.zmq_in_port]
 


Test patch:
Repository: spyder-ide/spyder

Issue:
Plots viewer arrows a bit too small
The arrows look rather slim and are hard to get when using the mouse.
<img width="199" alt="Screen Shot 2019-07-02 at 20 22 13" src="https://user-images.githubusercontent.com/3627835/60556482-21dd6480-9d07-11e9-9916-1f634194fe9a.png">



Discussion:

Resolving patch:
diff --git a/spyder/plugins/plots/widgets/figurebrowser.py b/spyder/plugins/plots/widgets/figurebrowser.py
--- a/spyder/plugins/plots/widgets/figurebrowser.py
+++ b/spyder/plugins/plots/widgets/figurebrowser.py
@@ -614,24 +614,18 @@ def setup_arrow_buttons(self):
         Setup the up and down arrow buttons that are placed at the top and
         bottom of the scrollarea.
         """
-        # Get the height of the up/down arrow of the default vertical
-        # scrollbar :
-        vsb = self.scrollarea.verticalScrollBar()
-        style = vsb.style()
-        opt = QStyleOptionSlider()
-        vsb.initStyleOption(opt)
-        vsb_up_arrow = style.subControlRect(
-                QStyle.CC_ScrollBar, opt, QStyle.SC_ScrollBarAddLine, self)
+        # Get the size hint height of the horizontal scrollbar.
+        height = self.scrollarea.horizontalScrollBar().sizeHint().height()
 
-        # Setup the up and down arrow button :
+        # Setup the up and down arrow button.
         up_btn = up_btn = QPushButton(icon=ima.icon('last_edit_location'))
         up_btn.setFlat(True)
-        up_btn.setFixedHeight(vsb_up_arrow.size().height())
+        up_btn.setFixedHeight(height)
         up_btn.clicked.connect(self.go_up)
 
         down_btn = QPushButton(icon=ima.icon('folding.arrow_down_on'))
         down_btn.setFlat(True)
-        down_btn.setFixedHeight(vsb_up_arrow.size().height())
+        down_btn.setFixedHeight(height)
         down_btn.clicked.connect(self.go_down)
 
         return up_btn, down_btn


Test patch:
Repository: spyder-ide/spyder

Issue:
Text in help search bar becomes selected once help is displayed
Following issues https://github.com/spyder-ide/spyder/issues/9143 and https://github.com/spyder-ide/spyder/issues/8762

**Steps to reproduce:**
* Import some package (e.g. `import numpy as np`)
* Try to get help for some function from that package by typing it in the editor (e.g. `np.arange`)

**Expected behavior:** should work in some way that I could quickly type `module.submodule.function_or_method` and get its helps displayed in the help pane.

**Actual behavior:** as soon as something that matches a package name (aliased or not) or something else with docs of its own is input, the whole text in the bar becomes selected, e.g. if I try to quickly type `np.arange` or `pandas.DataFrame.from_dict`, once it reaches `np` or `pandas` or `pandas.DataFrame`, the text becomes selected, and thus replaced with the next keystroke.

**Setup:** Spyder 3.3.5, running on Windows 10.


Discussion:
@dalthviz, please give priority to this one over your other work so we can release 3.3.6 as soon as possible. Thanks!

Resolving patch:
diff --git a/spyder/plugins/help.py b/spyder/plugins/help.py
--- a/spyder/plugins/help.py
+++ b/spyder/plugins/help.py
@@ -102,6 +102,9 @@ def validate(self, qstr, editing=True):
                 # A new item has just been selected
                 if valid:
                     self.selected()
+                    # See spyder-ide/spyder#9542.
+                    # Backport of PR spyder-ide/spyder#9552
+                    self.lineEdit().cursorWordForward(False)
                 else:
                     self.valid.emit(False, False)
 


Test patch:
diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py
--- a/spyder/app/tests/test_mainwindow.py
+++ b/spyder/app/tests/test_mainwindow.py
@@ -298,12 +298,14 @@ def test_get_help_combo(main_window, qtbot):
     qtbot.waitUntil(lambda: check_text(webpage, "NumPy"), timeout=6000)
 
     # Get help - numpy.arange
-    qtbot.keyClick(help_plugin.combo, Qt.Key_Right)
     qtbot.keyClicks(help_plugin.combo, '.arange', delay=100)
 
     # Check that a expected text is part of the page
     qtbot.waitUntil(lambda: check_text(webpage, "arange"), timeout=6000)
 
+    # Clear combo
+    help_plugin.combo.set_current_text('')
+
     # Get help - np
     qtbot.keyClicks(help_plugin.combo, 'np', delay=100)
 
@@ -311,7 +313,6 @@ def test_get_help_combo(main_window, qtbot):
     qtbot.waitUntil(lambda: check_text(webpage, "NumPy"), timeout=6000)
 
     # Get help - np.arange
-    qtbot.keyClick(help_plugin.combo, Qt.Key_Right)
     qtbot.keyClicks(help_plugin.combo, '.arange', delay=100)
 
     # Check that a expected text is part of the page
Repository: spyder-ide/spyder

Issue:
Equation is not displayed in Help pane on Windows
## Description
Equation is not displayed in help pane in windows.
Equation is displayed in help pane in linux(manjaro).

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

1. type -> from numpy import convolve
2. request help info of convolve

![dark](https://user-images.githubusercontent.com/22970578/60816179-1f31b200-a1d4-11e9-9606-5c4c39528fc5.png)
[windows]

![image](https://user-images.githubusercontent.com/22970578/60816951-b8ad9380-a1d5-11e9-8f5a-0bb1d5e3f96e.png)
[majaro]


## Versions

* Spyder version: 4.0.0b3 
* Python version: 3.7.3
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 10

### Dependencies

```
pygments >=2.0    :  2.3.1 (OK)
qdarkstyle >=2.6.4:  2.7 (OK)
sphinx >=0.6.6    :  1.8.5 (OK)
pyls >=0.27.0     :  0.27.0 (OK)
nbconvert >=4.0   :  5.4.1 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
numpy >=1.7       :  1.16.2 (OK)
sympy >=0.7.3     :  1.3 (OK)
cython >=0.21     :  0.29.6 (OK)
qtconsole >=4.5.0 :  4.5.1 (OK)
IPython >=4.0     :  7.4.0 (OK)
matplotlib >=2.0.0:  3.0.3 (OK)
pylint >=0.25     :  2.3.1 (OK)
```



Discussion:
@dalthviz, could you test this on Windows? Thanks!
@ccordoba12 testing this on Windows 8.1 I see the same behaviour reported by @ok97465 :

![imagen](https://user-images.githubusercontent.com/16781833/60831069-4eb5cf80-a17e-11e9-9ea7-28acf7add748.png)

Ok, thanks for the confirmation @dalthviz! Then please take a look at this one.

My guess is that we're not pointing to the right path where MathJax is located when trying to load the library in the generated web page.

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
@@ -183,6 +183,10 @@ def sphinxify(docstring, context, buildername='html'):
     # docstrings
     if context['right_sphinx_version'] and context['math_on']:
         docstring = docstring.replace('\\\\', '\\\\\\\\')
+        # Needed to prevent MathJax render the '\*' red.
+        # Also the '\*' seems to actually by a simple '*'
+        # See spyder-ide/spyder#9785
+        docstring = docstring.replace("\\*", "*")
 
     # Add a class to several characters on the argspec. This way we can
     # highlight them using css, in a similar way to what IPython does.


Test patch: