[GRASS-dev] [GRASS GIS] #3179: g.extension not installing addons behind proxy

GRASS GIS trac at osgeo.org
Mon Oct 10 08:32:58 PDT 2016


#3179: g.extension not installing addons behind proxy
----------------------------------------+-------------------------
 Reporter:  madi                        |      Owner:  grass-dev@…
     Type:  defect                      |     Status:  new
 Priority:  normal                      |  Milestone:  7.4.0
Component:  Addons                      |    Version:  unspecified
 Keywords:  g.extension, proxy, addons  |        CPU:  Unspecified
 Platform:  Unspecified                 |
----------------------------------------+-------------------------
 Related to https://lists.osgeo.org/pipermail/grass-
 user/2016-October/075337.html

 when i try to use g.extension behind a proxy, following the example from
 the manual, it gives me the following error:

 {{{
 g.extension ext=i.segment.hierarchical proxy="http://xx.xxx.xxx.xx:xxxx"
 Traceback (most recent call last):
   File "/usr/local/grass-7.3.svn/scripts/g.extension", line 1730, in
 <module>
     sys.exit(main())
   File "/usr/local/grass-7.3.svn/scripts/g.extension", line 1675, in main
     for ptype, purl in (p.split('=') for p in
 options['proxy'].split(',')):
 ValueError: need more than 1 value to unpack
 }}}

 Using the form suggested by Pietro:

 {{{
 proxy="http=<value>,ftp=<value>"
 }}}

 {{{
 g.extension ext=i.segment.hierarchical
 proxy="http=http://xx.xxx.xxx.xx:xxxx"
 }}}

 gives:

 {{{
 Fetching <i.segment.hierarchical> from GRASS GIS Addons repository (be
 patient)...
 ERROR: Extension <i.segment.hierarchical> not found
 }}}

 which is exactly the same as if I don't indicate the proxy at all.

 FWIW, I normally use urllib2 to handle the proxy. However I have some
 difficulties to apply this simple method to the 1700+ rows code (handling
 several different addons sources for several os's) of g.extension, but I'm
 behind a proxy and I'm available to test if you have a patch.

 Here's what I do in python:

 {{{
 import urllib2
 import os
 proxy = urllib2.ProxyHandler({'http':os.environ['HTTP_PROXY']})
 opener = urllib2.build_opener(proxy)
 urllib2.install_opener(opener)
 urllib2.urlopen('http://www.google.com')
 }}}

 Thanks

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3179>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list