How to get currently installed OpenerDirector and handlers from Python urllib?

33 Views Asked by At

Problem

In Python's urllib you can create an OpenerDirector instance with a list of request handlers and install it as default opener. However, I would like to access the already installed default OpenerDirector to see and eventually alter its list of handlers.

How can I do that?

Background

I have a complicated URL request where I need to access an FTP server with authentication via an HTTP proxy. It is a lab network, whose only connection to the internet is via the HTTP proxy.

This works with wget or curl calls, but instead of calling these by Python I would prefer to directly use a standard Python lib for that. In order to find out why it doesn't work yet, I'd like to have a close look at the involved handlers.

0

There are 0 best solutions below