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

Issue:
In ipdb, the up and down keys have a strange behaviour
## Description

**What steps will reproduce the problem?**

1. debug
2. press up to access the last thing you typed
3. wonder why you ended up in the middle of the history log

## Version and main components

* Spyder Version: 3.2.4.dev0 474e59379
* Python Version: 3.6.2
* Qt Versions: 5.9.1, PyQt5 5.9 on Darwin

## Dependencies
```
pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.1 (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)
psutil >=0.3     :  5.2.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.26 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.2 (OK)

```



Discussion:
Yep, I noticed this behavior too. I don't know why it happens though.
@dalthviz, please work on this one.
Apparently the problem is that the cursor doesn't go all the way down when pressing enter. It just goes down one line.

Resolving patch:
diff --git a/spyder/widgets/ipythonconsole/debugging.py b/spyder/widgets/ipythonconsole/debugging.py
--- a/spyder/widgets/ipythonconsole/debugging.py
+++ b/spyder/widgets/ipythonconsole/debugging.py
@@ -99,9 +99,10 @@ def _event_filter_console_keypress(self, event):
             elif key == Qt.Key_Down:
                 self._control.browse_history(backward=False)
                 return True
-            else:
-                return super(DebuggingWidget,
-                             self)._event_filter_console_keypress(event)
+            elif key in (Qt.Key_Return, Qt.Key_Enter):
+                self._control.reset_search_pos()
+            return super(DebuggingWidget,
+                         self)._event_filter_console_keypress(event)
         else:
             return super(DebuggingWidget,
                          self)._event_filter_console_keypress(event)
diff --git a/spyder/widgets/mixins.py b/spyder/widgets/mixins.py
--- a/spyder/widgets/mixins.py
+++ b/spyder/widgets/mixins.py
@@ -813,3 +813,7 @@ def find_in_history(self, tocursor, start_idx, backward):
                     return entry[len(tocursor):], idx
             else:
                 return None, start_idx
+
+    def reset_search_pos(self):
+        """Reset the position from which to search the history"""
+        self.histidx = None


Test patch:
Repository: spyder-ide/spyder

Issue:
Spyder crashes because of race condition in ZMQ
@pzwang reported that when starting Spyder in a CentOS 7 machine he got

```[pwang@localhost ~]$ spyder 
*** Error in `/home/pwang/anaconda2-5/bin/python': free(): invalid pointer: 0x00007fe9b3fffb80 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c503)[0x7fe9f7b20503]
/lib64/libLLVM-3.8-mesa.so(_ZNSt6locale5_Impl16_M_install_facetEPKNS_2idEPKNS_5facetE+0x142)[0x7fe9b35c53e2]
/lib64/libLLVM-3.8-mesa.so(_ZNSt6locale5_ImplC1Em+0x1e3)[0x7fe9b35a9803]
/lib64/libLLVM-3.8-mesa.so(_ZNSt6locale18_S_initialize_onceEv+0x15)[0x7fe9b35aa775]
/lib64/libpthread.so.0(pthread_once+0x50)[0x7fe9f857abb0]
/lib64/libLLVM-3.8-mesa.so(_ZNSt6locale13_S_initializeEv+0x21)[0x7fe9b35aa7c1]
/lib64/libLLVM-3.8-mesa.so(_ZNSt6localeC1Ev+0x13)[0x7fe9b35aa803]
/home/pwang/anaconda2-5/lib/python2.7/site-packages/zmq/backend/cython/../../../../../libzmq.so.5.1.2(_ZN3zmq13tcp_address_t9to_stringERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xb8)[0x7fe959e946c8]
/home/pwang/anaconda2-5/lib/python2.7/site-packages/zmq/backend/cython/../../../../../libzmq.so.5.1.2(_ZN3zmq14tcp_listener_t11set_addressEPKc+0x61)[0x7fe959e982c1]
/home/pwang/anaconda2-5/lib/python2.7/site-packages/zmq/backend/cython/../../../../../libzmq.so.5.1.2(_ZN3zmq13socket_base_t4bindEPKc+0x58e)[0x7fe959e8533e]
/home/pwang/anaconda2-5/lib/python2.7/site-packages/zmq/backend/cython/socket.so(+0x10880)[0x7fe9597cb880]
/home/pwang/anaconda2-5/lib/python2.7/site-packages/zmq/backend/cython/error.so(+0x2a9a)[0x7fe95a0cca9a]
/home/pwang/anaconda2-5/lib/python2.7/site-packages/zmq/backend/cython/error.so(+0x34fe)[0x7fe95a0cd4fe]
/home/pwang/anaconda2-5/bin/../lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7fe9f87d2653]
...
```

and according to @mingwandroid this is solved by importing `zmq` in `start.py` because of

> a race condition in zmq's initialization procedure


Discussion:

Resolving patch:
diff --git a/spyder/app/start.py b/spyder/app/start.py
--- a/spyder/app/start.py
+++ b/spyder/app/start.py
@@ -8,8 +8,12 @@
 import sys
 import time
 
+# To prevent a race condition with ZMQ
+# See issue 5324
+import zmq
+
 # This import is needed to fix errors with OpenGL when installed using pip
-# See issue #3332
+# See issue 3332
 try:
     from OpenGL import GL
 except ImportError:


Test patch:
Repository: spyder-ide/spyder

Issue:
Toggle comment (ctrl+1) does not always preserve indentation with 2 spaces
In the editor. Toggling comments works with indent=0 or 4 (spaces) but not with indent=2. Going back an forth, ie comment/uncomment using twice ctrl+1 results in an additional space (3), breaking python indentation.

Current spyder master.
My preferred indentation is set to 2 spaces.



Discussion:

Resolving patch:
diff --git a/spyder/widgets/sourcecode/codeeditor.py b/spyder/widgets/sourcecode/codeeditor.py
--- a/spyder/widgets/sourcecode/codeeditor.py
+++ b/spyder/widgets/sourcecode/codeeditor.py
@@ -307,7 +307,6 @@ def __init__(self, parent=None):
         # indent guides
         self.indent_guides = self.panels.register(IndentationGuide(self),
                                                   Panel.Position.FLOATING)
-
         # Blanks enabled
         self.blanks_enabled = False
 
@@ -1713,7 +1712,7 @@ def __even_number_of_spaces(self, line_text, group=0):
         """
         spaces = re.findall('\s+', line_text)
         if len(spaces) - 1 >= group:
-            return len(spaces[group]) % 4 == 0
+            return len(spaces[group]) % len(self.indent_chars) == 0
 
     def __number_of_spaces(self, line_text, group=0):
         """Get the number of spaces from a group of spaces in a line."""


Test patch:
Repository: spyder-ide/spyder

Issue:
Spyder crash when dragging a plugin with the mouse
## Description of your problem

**What steps will reproduce the problem?**

1. In `Views` uncheck `Lock panes`
2. Try to move a plugin with the mouse
3. Python is crashing systematically

![moving_plugins_around](https://user-images.githubusercontent.com/10170372/31626451-b433e6dc-b277-11e7-970c-c61da368b0e6.gif)

**Please provide any additional information below**

I think this bug was introduced in PR #3824. This is reproducible only in Spyder 4.0.0.dev0 (Commit: 777015f80) and not in Spyder 3.2.4.dev0 (Commit: 7b8042c0e).

## Versions and main components

* Spyder Version: Spyder 4.0.0.dev0 (Commit: 777015f80)
* Python Version: 3.6.2
* Qt Version: 5.9.1
* PyQt Version: 5.9
* Operating system: Windows 7 64 bits

## Dependencies

IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  0.25.2 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.2.1 (OK)
numpy >=1.7      :  1.13.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.1 (OK)
qtconsole >=4.2.0:  4.4.0.dev (OK)
rope >=0.9.4     :  0.10.7 (OK)
sphinx >=0.6.6   :  1.6.2 (OK)
sympy >=0.7.3    :  None (NOK)




Discussion:
@dalthviz, please take a look at this one.

Resolving patch:
diff --git a/spyder/plugins/base.py b/spyder/plugins/base.py
--- a/spyder/plugins/base.py
+++ b/spyder/plugins/base.py
@@ -193,7 +193,8 @@ def toggle_view(self, checked):
     @Slot()
     def create_window(self):
         """Open a window of the plugin instead of undocking it."""
-        if self.dockwidget.isFloating() and not self.undocked:
+        if (self.dockwidget.isFloating() and not self.undocked and
+                self.dockwidget.main.dockwidgets_locked):
             self.dockwidget.setFloating(False)
             self.dockwidget.setVisible(False)
             self.undock_action.setDisabled(True)
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py
--- a/spyder/plugins/editor.py
+++ b/spyder/plugins/editor.py
@@ -1513,7 +1513,8 @@ def setup_other_windows(self):
     @Slot()
     def create_window(self):
         """Open a new window instance of the Editor instead of undocking it."""
-        if self.dockwidget.isFloating() and not self.undocked:
+        if (self.dockwidget.isFloating() and not self.undocked and
+                self.dockwidget.main.dockwidgets_locked):
             self.dockwidget.setVisible(False)
             self.create_new_window()
             self.toggle_view_action.setChecked(False)


Test patch:
Repository: spyder-ide/spyder

Issue:
Can't enable debug mode
## Description of your problem

Spyder won't start in debug mode anymore. Several weeks ago this was working. It's broken now for a couple of weeks. Don't know the exact time when that changed. This affects branches 3.x as well as master.

**What steps will reproduce the problem?**

1. run bootstrap.py --debug

**What is the expected output? What do you see instead?**
*Expected:* Spyder should start up.
*Instead:* The program terminates with the message "ERROR: Can't enable debug mode - Spyder is already imported"

**Please provide any additional information below**

Debug mode will only be started if not `"spyder.config.base" in sys.modules`. However it seems that `from spyder.utils.vcs import get_git_revision` some lines earlier in `bootstrap.py` does always add this module to `sys.modules`.

I propose to move the code for enabling debugging up before the version information.


## Version and main components

* Spyder Version: 4.0.0.dev0 42175ba
* Python Version: 3.6.3
* Qt Versions: 5.6.2, PyQt5 5.6 on Windows

## Dependencies
```
pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.3 (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)
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)
pylint >=0.25    :  1.7.4 (OK)

```



Discussion:

Resolving patch:
diff --git a/bootstrap.py b/bootstrap.py
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -97,6 +97,16 @@
 
 # --- Continue
 
+if options.debug:
+    # safety check - Spyder config should not be imported at this point
+    if "spyder.config.base" in sys.modules:
+        sys.exit("ERROR: Can't enable debug mode - Spyder is already imported")
+    print("0x. Switching debug mode on")
+    os.environ["SPYDER_DEBUG"] = "True"
+    # this way of interaction suxx, because there is no feedback
+    # if operation is successful
+
+
 from spyder.utils.vcs import get_git_revision
 print("Revision %s, Branch: %s" % get_git_revision(DEVPATH))
 
@@ -124,16 +134,6 @@
     os.environ['QT_API'] = options.gui
 
 
-if options.debug:
-    # safety check - Spyder config should not be imported at this point
-    if "spyder.config.base" in sys.modules:
-        sys.exit("ERROR: Can't enable debug mode - Spyder is already imported")
-    print("0x. Switching debug mode on")
-    os.environ["SPYDER_DEBUG"] = "True"
-    # this way of interaction suxx, because there is no feedback
-    # if operation is successful
-
-
 # Checking versions (among other things, this has the effect of setting the
 # QT_API environment variable if this has not yet been done just above)
 from spyder import get_versions


Test patch:
Repository: spyder-ide/spyder

Issue:
Add Clear button to (find) entry boxes
## Description of your problem

Recently I searched for a lot of strings – one after the other. They all came from an electronic document, so I could use copy'n'paste. Since I work on Linux, I just selected the search strings by double clicking it and wanted to paste them with a middle click into the find box. But the box was still populated with the search string from the previous search. This string had to be deleted first. Selecting it and middle click obviously does not work, so had to click into the entry box, switch to the keyboard (CTRL-A, DEL) and paste again with the mouse.

It would have been so much quicker if there were a "Clear search box" button as you can now see nearly everywhere.

Could you please provide such a button in every search box (I can come up with four: The _Editor_ has Find, Find + Replace, the _Find in files_ has one, _Help_ another, but there might be more.) Maybe other entry boxes can also gain from a Clear button?

## Versions and main components

* Spyder Version: 3.2.3 
* Python Version: 3.5.2 64bits
* Qt Version: 5.5.1
* PyQt Version: 5.5.1
* Operating system: Linux Mint 18.1


## Dependencies

Please go to the menu entry `Help > Optional Dependencies` (or
`Help > Dependencies`), press the button `Copy to clipboard`
and paste the contents below:
IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  None (NOK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
numpy >=1.7      :  1.12.0 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
psutil >=0.3     :  5.3.1 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.6.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.2 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.10.7 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
sympy >=0.7.3    :  1.0 (OK)



Discussion:
It's a nice suggestion. Thanks for bringing it up to our attention.

We'll try to implement it in our 3.2.5 version. @andfoy, please work on this one.

Resolving patch:
diff --git a/spyder/widgets/comboboxes.py b/spyder/widgets/comboboxes.py
--- a/spyder/widgets/comboboxes.py
+++ b/spyder/widgets/comboboxes.py
@@ -135,6 +135,8 @@ class PatternComboBox(BaseComboBox):
     def __init__(self, parent, items=None, tip=None,
                  adjust_to_minimum=True):
         BaseComboBox.__init__(self, parent)
+        if hasattr(self.lineEdit(), 'setClearButtonEnabled'):  # only Qt >= 5.2
+            self.lineEdit().setClearButtonEnabled(True)
         if adjust_to_minimum:
             self.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
         self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)


Test patch:
Repository: spyder-ide/spyder

Issue:
Explicitly stated default Russian encoding on Windows not recognized
The default Russian encoding on Windows (cp1251) is not recognized in spite of being explicitly
stated in the first line of the file.

**What steps will reproduce the problem?**
I open a file with the first line reading
    
    # -*- coding: cp1251 -*-

**What is the expected output? What do you see instead?**
I expect it to be opened in Windows-1251 encoding
I get it opened in LATIN-1-GUESSED instead.

**Please provide any additional information below**
There're "iso8859-5" and "koi8-r" for Russian, but on Windows the default encoding is cp1251 (Windows-1251), which is significantly different from both.

When there're enough characters for the autodetection to work, everything is fine, but when there're just a couple of words I get the behaviour described above.

## Versions and main components

* Spyder Version: 3.2.5 32 bits
* Python Version: 3.6.2
* Qt Version: 5.9.1
* PyQt Version: 5 5.9
* Operating system: Windows 7

## Dependencies

IPython >=4.0 : 6.2.1 (OK)
cython >=0.21 : None (NOK)
jedi >=0.9.0 : 0.11.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : None (NOK)
pandas >=0.13.1 : None (NOK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.4 (OK)
sympy >=0.7.3 : None (NOK)


Discussion:

Resolving patch:
diff --git a/spyder/utils/encoding.py b/spyder/utils/encoding.py
--- a/spyder/utils/encoding.py
+++ b/spyder/utils/encoding.py
@@ -94,7 +94,7 @@ def to_fs_from_unicode(unic):
 
 # Codecs for working with files and text.
 CODING_RE = re.compile(r"coding[:=]\s*([-\w_.]+)")
-CODECS = ['utf-8', 'iso8859-1',  'iso8859-15', 'ascii', 'koi8-r',
+CODECS = ['utf-8', 'iso8859-1',  'iso8859-15', 'ascii', 'koi8-r', 'cp1251',
           'koi8-u', 'iso8859-2', 'iso8859-3', 'iso8859-4', 'iso8859-5',
           'iso8859-6', 'iso8859-7', 'iso8859-8', 'iso8859-9',
           'iso8859-10', 'iso8859-13', 'iso8859-14', 'latin-1',


Test patch:
Repository: spyder-ide/spyder

Issue:
Runtime Error raised while closing IPython Console instance
## Description

**What steps will reproduce the problem?**

1. 
2. 
3. 

**What is the expected output? What do you see instead?**


**Please provide any additional information below**

  File "C:\ProgramData\Anaconda2\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1236, in close_client
    client.stop_button_click_handler()
  File "C:\ProgramData\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\client.py", line 235, in stop_button_click_handler
    self.interrupt_kernel()
  File "C:\ProgramData\Anaconda2\lib\site-packages\spyder\widgets\ipythonconsole\client.py", line 391, in interrupt_kernel
    self.shellwidget.request_interrupt_kernel()
  File "C:\ProgramData\Anaconda2\lib\site-packages\qtconsole\frontend_widget.py", line 345, in request_interrupt_kernel
    self.interrupt_kernel()
  File "C:\ProgramData\Anaconda2\lib\site-packages\qtconsole\frontend_widget.py", line 638, in interrupt_kernel
    self.kernel_manager.interrupt_kernel()
  File "C:\ProgramData\Anaconda2\lib\site-packages\jupyter_client\manager.py", line 408, in interrupt_kernel
    raise RuntimeError("Cannot interrupt kernel. No kernel is running!")
RuntimeError: Cannot interrupt kernel. No kernel is running!


## Version and main components

* Spyder Version: 3.2.3 
* Python Version: 2.7.13
* Qt Versions: 5.6.2, PyQt5 5.6 on Windows

## Dependencies
```
pyflakes >=0.5.0  :  1.5.0 (OK)
pycodestyle >=2.3 :  2.3.1 (OK)



Discussion:
111
Thanks for reporting.

@dalthviz, please work on this one. The fix simply consists in surrounding `client.stop_button_click_handler()` with a try/except that catches `RuntimeError`.

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py
--- a/spyder/plugins/ipythonconsole.py
+++ b/spyder/plugins/ipythonconsole.py
@@ -1249,8 +1249,12 @@ def close_client(self, index=None, client=None, force=False):
         if index is not None:
             client = self.tabwidget.widget(index)
 
-        # Close client
-        client.stop_button_click_handler()
+        # Needed to handle a RuntimeError. See issue 5568.
+        try:
+            # Close client
+            client.stop_button_click_handler()
+        except RuntimeError:
+            pass
 
         # Check if related clients or kernels are opened
         # and eventually ask before closing them


Test patch:
Repository: spyder-ide/spyder

Issue:
Right-clicking in empty Project Explorer shows error
## Description

**What steps will reproduce the problem?**

1. Show the Project Explorer.
2. If there are no projects, right click on the text part.
3. 

**What is the expected output? What do you see instead?**
I expect to see the context menu or nothing at all, but not an error window.

**Please provide any additional information below**

  File "/home/cheryl/spyder/spyder/widgets/explorer.py", line 483, in contextMenuEvent
    self.update_menu()
  File "/home/cheryl/spyder/spyder/widgets/explorer.py", line 462, in update_menu
    add_actions(self.menu, self.create_context_menu_actions())
  File "/home/cheryl/spyder/spyder/widgets/explorer.py", line 432, in create_context_menu_actions
    fnames = self.get_selected_filenames()
  File "/home/cheryl/spyder/spyder/widgets/explorer.py", line 248, in get_selected_filenames
    self.selectionModel().selectedRows()]
AttributeError: 'NoneType' object has no attribute 'selectedRows'


## Version and main components

* Spyder Version: 4.0.0.dev0 f696a06
* Python Version: 3.6.3
* Qt Versions: 5.6.2, PyQt5 5.6 on Linux

## Dependencies
```
pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.3 (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)
psutil >=0.3     :  5.4.0 (OK)
nbconvert >=4.0  :  5.3.1 (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)
pylint >=0.25    :  1.7.4 (OK)

```



Discussion:

Resolving patch:
diff --git a/spyder/widgets/explorer.py b/spyder/widgets/explorer.py
--- a/spyder/widgets/explorer.py
+++ b/spyder/widgets/explorer.py
@@ -244,6 +244,8 @@ def get_index(self, filename):
     def get_selected_filenames(self):
         """Return selected filenames"""
         if self.selectionMode() == self.ExtendedSelection:
+            if self.selectionModel() is None:
+                return []
             return [self.get_filename(idx) for idx in 
                     self.selectionModel().selectedRows()]
         else:


Test patch:
Repository: spyder-ide/spyder

Issue:
AttributeError: 'InternalShell' object has no attribute 'is_running'
## Description

**What steps will reproduce the problem?**

1. 
2. 
3. 

**What is the expected output? What do you see instead?**


**Please provide any additional information below**

  File "/Users/goldiefan/anaconda3/lib/python3.6/site-packages/spyder/plugins/help.py", line 838, in toggle_plain_text
    self.force_refresh()
  File "/Users/goldiefan/anaconda3/lib/python3.6/site-packages/spyder/plugins/help.py", line 750, in force_refresh
    self.set_object_text(None, force_refresh=True)
  File "/Users/goldiefan/anaconda3/lib/python3.6/site-packages/spyder/plugins/help.py", line 765, in set_object_text
    found = self.show_help(text, ignore_unknown=ignore_unknown)
  File "/Users/goldiefan/anaconda3/lib/python3.6/site-packages/spyder/plugins/help.py", line 928, in show_help
    shell = self.get_shell()
  File "/Users/goldiefan/anaconda3/lib/python3.6/site-packages/spyder/plugins/help.py", line 890, in get_shell
    if not hasattr(self.shell, 'get_doc') or not self.shell.is_running():
AttributeError: 'InternalShell' object has no attribute 'is_running'


## Version and main components

* Spyder Version: 3.2.3 
* Python Version: 3.6.2
* Qt Versions: 5.6.2, PyQt5 5.6 on Darwin

## Dependencies
```
pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.1 (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)
psutil >=0.3     :  5.2.2 (OK)
nbconvert >=4.0  :  5.3.1 (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)
pylint >=0.25    :  1.7.2 (OK)

```



Discussion:
Thanks for reporting. We'll fix this error in our next release.
@dalthviz, an easy one for you.

Resolving patch:
diff --git a/spyder/plugins/help.py b/spyder/plugins/help.py
--- a/spyder/plugins/help.py
+++ b/spyder/plugins/help.py
@@ -887,7 +887,9 @@ def get_shell(self):
         Return shell which is currently bound to Help,
         or another running shell if it has been terminated
         """
-        if not hasattr(self.shell, 'get_doc') or not self.shell.is_running():
+        if (not hasattr(self.shell, 'get_doc') or
+                (hasattr(self.shell, 'is_running') and
+                 not self.shell.is_running())):
             self.shell = None
             if self.main.ipyconsole is not None:
                 shell = self.main.ipyconsole.get_current_shellwidget()


Test patch: