Repository: spyder-ide/spyder

Issue:
VersionConflict when opening a file in the Editor
## Description

### What steps will reproduce the problem?

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

Evrytime i try to open new sypder instance it creates same issue.

### Traceback
```python-traceback
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\projects.py", line 147, in <lambda>
    lambda v: self.main.editor.setup_open_files())
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor.py", line 2716, in setup_open_files
    self.load(filenames)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\plugins\editor.py", line 1944, in load
    finfo = self.editorstacks[0].load(filename, set_current=False)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 2252, in load
    finfo = self.create_new_editor(filename, enc, text, set_current)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\editor.py", line 2170, in create_new_editor
    filename=fname)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\sourcecode\codeeditor.py", line 729, in setup_editor
    self.set_language(language, filename)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\widgets\sourcecode\codeeditor.py", line 837, in set_language
    sh_class = sh.guess_pygments_highlighter(filename)
  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\syntaxhighlighters.py", line 1207, in guess_pygments_highlighter
    lexer = get_lexer_for_filename(filename)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pygments\lexers\__init__.py", line 203, in get_lexer_for_filename
    res = find_lexer_class_for_filename(_fn, code)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pygments\lexers\__init__.py", line 168, in find_lexer_class_for_filename
    for cls in find_plugin_lexers():
  File "C:\ProgramData\Anaconda3\lib\site-packages\pygments\plugin.py", line 55, in find_plugin_lexers
    yield entrypoint.load()
  File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2345, in load
    self.require(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2368, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 789, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (urllib3 1.24.1 (c:\programdata\anaconda3\lib\site-packages), Requirement.parse('urllib3[secure]<1.23,>=1.21.1'))
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.2 
* Python version: 3.7.2
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 10

### Dependencies

```
pyflakes >=0.6.0  :  2.0.0 (OK)
pycodestyle >=2.3 :  2.4.0 (OK)
pygments >=2.0    :  2.3.1 (OK)
sphinx >=0.6.6    :  1.8.2 (OK)
rope >=0.9.4      :  0.11.0 (OK)
jedi >=0.9.0      :  0.13.2 (OK)
nbconvert >=4.0   :  5.3.1 (OK)
pandas >=0.13.1   :  0.24.0 (OK)
numpy >=1.7       :  1.15.4 (OK)
sympy >=0.7.3     :  1.3 (OK)
cython >=0.21     :  0.29.2 (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:
Thanks for reporting.We'll take a look at this in a future release.

Resolving patch:
diff --git a/spyder/utils/syntaxhighlighters.py b/spyder/utils/syntaxhighlighters.py
--- a/spyder/utils/syntaxhighlighters.py
+++ b/spyder/utils/syntaxhighlighters.py
@@ -1196,16 +1196,18 @@ def guess_pygments_highlighter(filename):
     """
     try:
         from pygments.lexers import get_lexer_for_filename, get_lexer_by_name
-        from pygments.util import ClassNotFound
-    except ImportError:
+    except Exception:
         return TextSH
     root, ext = os.path.splitext(filename)
     if ext in custom_extension_lexer_mapping:
-        lexer = get_lexer_by_name(custom_extension_lexer_mapping[ext])
+        try:
+            lexer = get_lexer_by_name(custom_extension_lexer_mapping[ext])
+        except Exception:
+            return TextSH
     else:
         try:
             lexer = get_lexer_for_filename(filename)
-        except ClassNotFound:
+        except Exception:
             return TextSH
     class GuessedPygmentsSH(PygmentsSH):
         _lexer = lexer


Test patch: