Repository: spyder-ide/spyder

Issue:
"Unable to connect to the internet" problem
When spyder starts up, or when I check for update, I get this warning. I am behind a company firewall. I do not know how to configure Spyder to know about our proxy.

I installed Spyder via pip install, and I do not have anaconda. From a browser I can get to "https://api.github.com/repos/spyder-ide/spyder/releases" without any problem.

Thank you.

* Spyder Version: 3.1.3
* Python Version: 2.7.13
* Qt Version: 4
* PyQt Version: 4.11.4
* Operating system: Windows 7

## Dependencies

jedi =0.9.0      :  0.9.0 (OK)
matplotlib >=1.0 :  1.5.2 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.19.2 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.5.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.6.5 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.10.5 (OK)
sphinx >=0.6.6   :  1.5.3 (OK)
sympy >=0.7.3    :  None (NOK)



Discussion:
Please go to

    Tools > Preferences > General > Advanced Settings > Check for updates on startup

and disable it.
Thanks for that. Just to clarify: you're saying I should disable this check on startup, and if I want to update spyder, I should manually run "pip install -U spyder". 

No need to answer if this is correct :)
Yeah, if you deactivate that option then you should stop seeing that annoying message. The dialog just informs you that a new version is available, but it won't update it for you, so in any case you need to run `pip install -U spyder` to do it.
@rlaverde, please work on this one. The idea is *not* show the message about not being able to connect to the internet if it's not possible to do it.

That will avoid annoying our users, specially the ones that work on environments with restricted connectivity.

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -1230,7 +1230,7 @@ def post_visible_setup(self):
         # Check for spyder updates
         if DEV is None and CONF.get('main', 'check_updates_on_startup'):
             self.give_updates_feedback = False
-            self.check_updates()
+            self.check_updates(startup=True)
 
         # Show dialog with missing dependencies
         self.report_missing_dependencies()
@@ -2816,7 +2816,7 @@ def _check_updates_ready(self):
         self.give_updates_feedback = True
 
     @Slot()
-    def check_updates(self):
+    def check_updates(self, startup=False):
         """
         Check for spyder updates on github releases using a QThread.
         """
@@ -2829,7 +2829,7 @@ def check_updates(self):
             self.thread_updates.terminate()
 
         self.thread_updates = QThread(self)
-        self.worker_updates = WorkerUpdates(self)
+        self.worker_updates = WorkerUpdates(self, startup=startup)
         self.worker_updates.sig_ready.connect(self._check_updates_ready)
         self.worker_updates.sig_ready.connect(self.thread_updates.quit)
         self.worker_updates.moveToThread(self.thread_updates)
diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py
--- a/spyder/workers/updates.py
+++ b/spyder/workers/updates.py
@@ -32,11 +32,12 @@ class WorkerUpdates(QObject):
     """
     sig_ready = Signal()
 
-    def __init__(self, parent):
+    def __init__(self, parent, startup):
         QObject.__init__(self)
         self._parent = parent
         self.error = None
         self.latest_release = None
+        self.startup = startup
 
     def check_update_available(self, version, releases):
         """Checks if there is an update available.
@@ -95,5 +96,7 @@ def start(self):
         except Exception:
             error_msg = _('Unable to check for updates.')
 
-        self.error = error_msg
-        self.sig_ready.emit()
+        # Don't show dialog when starting up spyder and an error occur
+        if not (self.startup and error_msg is not None):
+            self.error = error_msg
+            self.sig_ready.emit()


Test patch: