Repository: spyder-ide/spyder

Issue:
Can't run profiler
## Description

### What steps will reproduce the problem?

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

From the `run` menu, I attempted to open the profile.

### Traceback
```python-traceback
  File "c:\program files\enthought\canopy\edm\envs\py36\lib\site-packages\spyder_profiler\widgets\profilergui.py", line 262, in <lambda>
    lambda: self.read_output(error=True))
  File "c:\program files\enthought\canopy\edm\envs\py36\lib\site-packages\spyder_profiler\widgets\profilergui.py", line 323, in read_output
    text = to_text_string( locale_codec.toUnicode(qba.data()) )
AttributeError: 'NoneType' object has no attribute 'toUnicode'
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 404, 'json': {'message': 'Not Found', 'documentation_url': 'https://developer.github.com/v3/issues/#create-an-issue'}}
```

## Versions

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

### Dependencies

```
pyflakes >=0.6.0  :  2.1.1 (OK)
pycodestyle >=2.3 :  2.5.0 (OK)
pygments >=2.0    :  2.2.0 (OK)
sphinx >=0.6.6    :  1.8.5 (OK)
rope >=0.9.4      :  0.14.0 (OK)
jedi >=0.9.0      :  0.13.3 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
pandas >=0.13.1   :  0.23.4 (OK)
numpy >=1.7       :  1.15.4 (OK)
sympy >=0.7.3     :  None (NOK)
cython >=0.21     :  0.28.5 (OK)
qtconsole >=4.2.0 :  4.4.0.dev (OK)
IPython >=4.0     :  7.5.0 (OK)
matplotlib >=2.0.0:  2.2.4 (OK)
pylint >=0.25     :  2.3.1 (OK)
```



Discussion:
Thanks for reporting. We'll take a look at this in our next version.

Resolving patch:
diff --git a/spyder_breakpoints/widgets/breakpointsgui.py b/spyder_breakpoints/widgets/breakpointsgui.py
--- a/spyder_breakpoints/widgets/breakpointsgui.py
+++ b/spyder_breakpoints/widgets/breakpointsgui.py
@@ -19,8 +19,7 @@
 # Third party imports
 from qtpy import API
 from qtpy.compat import to_qvariant
-from qtpy.QtCore import (QAbstractTableModel, QModelIndex, QTextCodec, Qt,
-                         Signal)
+from qtpy.QtCore import QAbstractTableModel, QModelIndex, Qt, Signal
 from qtpy.QtWidgets import (QItemDelegate, QMenu, QTableView, QVBoxLayout,
                             QWidget)
 
@@ -37,9 +36,6 @@
     _ = gettext.gettext
 
 
-locale_codec = QTextCodec.codecForLocale()
-
-
 class BreakpointTableModel(QAbstractTableModel):
     """
     Table model for breakpoints dictionary
diff --git a/spyder_profiler/widgets/profilergui.py b/spyder_profiler/widgets/profilergui.py
--- a/spyder_profiler/widgets/profilergui.py
+++ b/spyder_profiler/widgets/profilergui.py
@@ -24,8 +24,7 @@
 
 # Third party imports
 from qtpy.compat import getopenfilename, getsavefilename
-from qtpy.QtCore import (QByteArray, QProcess, QProcessEnvironment, QTextCodec,
-                         Qt, Signal)
+from qtpy.QtCore import QByteArray, QProcess, QProcessEnvironment, Qt, Signal
 from qtpy.QtGui import QColor
 from qtpy.QtWidgets import (QApplication, QHBoxLayout, QLabel, QMessageBox,
                             QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget)
@@ -49,9 +48,6 @@
     _ = gettext.gettext
 
 
-locale_codec = QTextCodec.codecForLocale()
-
-
 def is_profiler_installed():
     from spyder.utils.programs import is_module_installed
     return is_module_installed('cProfile') and is_module_installed('pstats')
@@ -320,7 +316,7 @@ def read_output(self, error=False):
                 qba += self.process.readAllStandardError()
             else:
                 qba += self.process.readAllStandardOutput()
-        text = to_text_string( locale_codec.toUnicode(qba.data()) )
+        text = to_text_string(qba.data(), encoding='utf-8')
         if error:
             self.error_output += text
         else:
diff --git a/spyder_pylint/widgets/pylintgui.py b/spyder_pylint/widgets/pylintgui.py
--- a/spyder_pylint/widgets/pylintgui.py
+++ b/spyder_pylint/widgets/pylintgui.py
@@ -21,7 +21,7 @@
 # Third party imports
 import pylint
 from qtpy.compat import getopenfilename
-from qtpy.QtCore import QByteArray, QProcess, QTextCodec, Signal, Slot
+from qtpy.QtCore import QByteArray, QProcess, Signal, Slot
 from qtpy.QtWidgets import (QHBoxLayout, QLabel, QMessageBox, QTreeWidgetItem,
                             QVBoxLayout, QWidget)
 
@@ -46,7 +46,6 @@
     import gettext
     _ = gettext.gettext
 
-locale_codec = QTextCodec.codecForLocale()
 PYLINT_REQVER = '>=0.25'
 PYLINT_VER = pylint.__version__
 dependencies.add("pylint", _("Static code analysis"),
@@ -334,7 +333,7 @@ def read_output(self, error=False):
                 qba += self.process.readAllStandardError()
             else:
                 qba += self.process.readAllStandardOutput()
-        text = to_text_string( locale_codec.toUnicode(qba.data()) )
+        text = to_text_string(qba.data(), encoding='utf-8')
         if error:
             self.error_output += text
         else:


Test patch: