Bug report #13412

processing ''Get online scripts' does not honor QGIS proxy settings?

Added by Richard Duivenvoorde over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21461

Description

Testing the 'Get Online Scripts' here in a proxied environment.

It fails to get a connection. Probably because it does not use the proxy settings.

There are some plugins which do this right. I think the QuickMapServices plugin is the best one. As it uses a QNetworkRequest:

https://github.com/nextgis/quickmapservices/blob/master/src/extra_sources.py#L121-L148

I had a patch from somebody once too (see below), but the above is probably better :

https://github.com/rduivenvoorde/pdokservicesplugin/blob/master/pdokgeocoder.py#L24-L45

Traceback (most recent call last):
  File "C:/Users/operatortp/.qgis2/python/plugins\\processing\\gui\\ProcessingToolbox.py", line 223, in executeAlgorithm
    action.execute()
  File "C:/Users/operatortp/.qgis2/python/plugins\\processing\\gui\\GetScriptsAndModels.py", line 63, in execute
    dlg = GetScriptsAndModelsDialog(GetScriptsAndModelsDialog.SCRIPTS)
  File "C:/Users/operatortp/.qgis2/python/plugins\\processing\\gui\\GetScriptsAndModels.py", line 160, in __init__
    self.populateTree()
  File "C:/Users/operatortp/.qgis2/python/plugins\\processing\\gui\\GetScriptsAndModels.py", line 175, in populateTree
    resources = readUrl(self.urlBase + 'list.txt').splitlines()
  File "C:/Users/operatortp/.qgis2/python/plugins\\processing\\gui\\GetScriptsAndModels.py", line 118, in readUrl
    return urllib2.urlopen(url).read()
  File "C:\\osgeo4w\\apps\\Python27\\lib\\urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\\osgeo4w\\apps\\Python27\\lib\\urllib2.py", line 404, in open
    response = self._open(req, data)
  File "C:\\osgeo4w\\apps\\Python27\\lib\\urllib2.py", line 422, in _open
    '_open', req)
  File "C:\\osgeo4w\\apps\\Python27\\lib\\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "C:\\osgeo4w\\apps\\Python27\\lib\\urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "C:\\osgeo4w\\apps\\Python27\\lib\\urllib2.py", line 1184, in do_open
    raise URLError(err)
URLError: 

Python version:
2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.10.1-Pisa Pisa, d20c5b7

Python path: ['C:/Users/operatortp/.qgis2/python/plugins\\\\processing', 'C:\\\\Users\\\\operatortp\\\\.qgis2\\\\python\\\\plugins\\\\GeoCoding\\\\libs', 'C:/osgeo4w/apps/qgis/./python', u'C:/Users/operatortp/.qgis2/python', u'C:/Users/operatortp/.qgis2/python/plugins', 'C:/osgeo4w/apps/qgis/./python/plugins', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\distribute-0.6.24-py2.7.egg', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\mapproxy-1.4.0-py2.7.egg', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\pyyaml-3.10-py2.7-win32.egg', 'C:\\\\osgeo4w\\\\bin\\\\python27.zip', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\DLLs', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\plat-win', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\lib-tk', 'C:\\\\osgeo4w\\\\bin', 'C:\\\\osgeo4w\\\\apps\\\\Python27', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\jinja2-2.7.2-py2.7.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\markupsafe-0.23-py2.7-win32.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\python_dateutil-2.2-py2.7.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\pytz-2014.2-py2.7.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\shapely-1.2.18-py2.7-win32.egg', 'c:\\\\osgeo4w\\\\apps\\\\python27\\\\lib\\\\site-packages\\\\six-1.6.1-py2.7.egg', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\PIL', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\win32\\\\lib', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\Pythonwin', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\setuptools-0.6c11-py2.7.egg-info', 'C:\\\\osgeo4w\\\\apps\\\\Python27\\\\lib\\\\site-packages\\\\wx-2.8-msw-unicode', u'C:/Users/operatortp/.qgis2//python', 'C:\\\\Users\\\\operatortp\\\\.qgis2\\\\python\\\\plugins\\\\mmqgis/forms', 'C:\\\\Users\\\\operatortp\\\\.qgis2\\\\python\\\\plugins\\\\pdokbaggeocoder/forms', 'C:\\\\osgeo4w\\\\apps\\\\qgis\\\\python\\\\plugins\\\\fTools\\\\tools', 'C:/Users/operatortp/.qgis2']

Associated revisions

Revision f2e527f0
Added by Médéric Ribreux over 8 years ago

[Processing] Add proxy support for Get scripts and models (fixes #13412)

Revision 584c86d6
Added by Victor Olaya over 8 years ago

Merge pull request #2403 from medspx/processing_get_scripts_proxy

[Processing] Add proxy support for Get scripts and models (fixes #13412)

History

#1 Updated by Médéric RIBREUX over 8 years ago

I've written a PR ...

#2 Updated by Victor Olaya over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF