Repository: spyder-ide/spyder

Issue:
Opening a new editor window results in an error
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

Repros every time in ``--safe-mode`` as well as normal. @ok97465 reported this on Gitter as well.

Perhaps we should include a simple regression test for this...


### Traceback
```python-traceback
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\plugin.py", line 1289, in create_new_window
    sort_files_alphabetically=oe_options['sort_files_alphabetically'])
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\editor.py", line 2886, in __init__
    sort_files_alphabetically)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\editor.py", line 2822, in __init__
    unregister_editorstack_cb=self.unregister_editorstack)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\editor.py", line 2596, in __init__
    self.register_editorstack_cb(self.editorstack)
  File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\editor.py", line 2849, in register_editorstack
    self.readwrite_status.readonly_changed)
AttributeError: 'ReadWriteStatus' object has no attribute 'readonly_changed'
```

## Versions

* Spyder version: 4.0.0.dev0 719f56082
* Python version: 3.7.2
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 8.1

### Dependencies

```
pygments >=2.0    :  2.3.1 (OK)
qdarkstyle >=2.6.4:  2.6.5 (OK)
sphinx >=0.6.6    :  1.8.4 (OK)
pyls >=0.19.0     :  0.21.5 (OK)
nbconvert >=4.0   :  5.4.0 (OK)
pandas >=0.13.1   :  0.24.2 (OK)
numpy >=1.7       :  1.15.4 (OK)
sympy >=0.7.3     :  1.3 (OK)
cython >=0.21     :  0.29.4 (OK)
qtconsole >=4.2.0 :  4.4.3 (OK)
IPython >=4.0     :  7.2.0 (OK)
matplotlib >=2.0.0:  3.0.2 (OK)
pylint >=0.25     :  2.2.2 (OK)
```



Discussion:
@dalthviz, please take a look at this one.
I think I know what the problem is.
@goanpeca the problem is related with the calling `readonly_changed` instead of  `update_readonly` or something like that?

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
@@ -2846,12 +2846,12 @@ def register_editorstack(self, editorstack):
         editorstack.reset_statusbar.connect(self.encoding_status.hide)
         editorstack.reset_statusbar.connect(self.cursorpos_status.hide)
         editorstack.readonly_changed.connect(
-                                        self.readwrite_status.readonly_changed)
+                                        self.readwrite_status.update_readonly)
         editorstack.encoding_changed.connect(
-                                         self.encoding_status.encoding_changed)
+                                         self.encoding_status.update_encoding)
         editorstack.sig_editor_cursor_position_changed.connect(
-                     self.cursorpos_status.cursor_position_changed)
-        editorstack.sig_refresh_eol_chars.connect(self.eol_status.eol_changed)
+                     self.cursorpos_status.update_cursor_position)
+        editorstack.sig_refresh_eol_chars.connect(self.eol_status.update_eol)
         self.plugin.register_editorstack(editorstack)
         oe_btn = create_toolbutton(self)
         oe_btn.setDefaultAction(self.outlineexplorer.visibility_action)


Test patch: