cicku / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
1 stars 0 forks source link

Python bindings does not handle libproxy returning NULL #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In python shell:
2. >> import libproxy
3. >> pf = libproxy.ProxyFactory()
4. >> pf.getProxies("http://test.com/")

What is the expected output? What do you see instead?
Base on issue 116, libproxy terminate with internal failures and returns
NULL. The NULL returned value is not handled by the python bindings.

Please use labels and text to provide additional information.

The backtrace:
/usr/lib64/python2.6/site-packages/libproxy.pyc in getProxies(self, url)
    103         array = _libproxy.px_proxy_factory_get_proxies(self._pf, url)
    104         i=0
--> 105         while array[i]:
    106             proxies.append(str(ctypes.cast(array[i],
ctypes.c_char_p).value))
    107             _libc.free(array[i])

Original issue reported on code.google.com by nicolas.dufresne@gmail.com on 21 May 2010 at 3:55

GoogleCodeExporter commented 9 years ago
Fixed in r680, the binding will now raise ProxyResolutionError

Original comment by nicolas.dufresne@gmail.com on 1 Jun 2010 at 5:58

GoogleCodeExporter commented 9 years ago

Original comment by nicolas.dufresne@gmail.com on 7 Jun 2010 at 3:50