VirtualBox

Ignore:
Timestamp:
Jun 20, 2018 3:42:03 PM (6 years ago)
Author:
vboxsync
Message:

webutils.py: Fixed the fNoProxies parameter for downloadFile().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/common/webutils.py

    r70660 r72632  
    4343    from urllib.parse   import urlencode    as urllib_urlencode;    # pylint: disable=import-error,no-name-in-module
    4444    from urllib.request import urlopen      as urllib_urlopen;      # pylint: disable=import-error,no-name-in-module
     45    import urllib.request;                                          # pylint: disable=import-error,no-name-in-module
    4546
    4647# Validation Kit imports.
     
    147148          http_proxy, ftp_proxy, no_proxy environment variables.
    148149
    149     @todo Fixed build burn here. Please set default value for fNoProxies
    150           to appropriate one.
    151150    """
    152151    if fnError is None:
     
    160159        try:
    161160            ## @todo We get 404.html content instead of exceptions here, which is confusing and should be addressed.
    162             if fNoProxies:
     161            if not fNoProxies:
    163162                oSrc = urllib_urlopen(sUrlFile);
     163            elif sys.version_info[0] < 3:
     164                oSrc = urllib_urlopen(sUrlFile, proxies = dict());
    164165            else:
    165                 oSrc = urllib_urlopen(sUrlFile, proxies = dict());
     166                oProxyHandler = urllib.request.ProxyHandler(proxies = dict()); # p?ylint: disable=???
     167                oOpener = urllib.request.build_opener(oProxyHandler)           # p?ylint: disable=???
     168                oSrc = oOpener.open(sUrlFile);
    166169            oDst = utils.openNoInherit(sDstFile, 'wb');
    167170            oDst.write(oSrc.read());
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette