diff --git a/CHANGES b/CHANGES index e894226..2ca4b05 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +## 1.0.4 + +* Replace urllib.request.URLopener import, defunct in Python 3.14, with urlretrieve. + ## 1.0.3 * Remediated security vulnerability caused by messaging complete file path in diff --git a/setup.py b/setup.py index 55fa8f5..d7a68bd 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ def read(*parts): setup( name='wagon', - version='1.0.3', + version='1.0.4', url='https://github.com/cloudify-cosmo/wagon', author='Cloudify', author_email='cosmo-admin@cloudify.co', diff --git a/test_env/lib64 b/test_env/lib64 new file mode 120000 index 0000000..7951405 --- /dev/null +++ b/test_env/lib64 @@ -0,0 +1 @@ +lib \ No newline at end of file diff --git a/wagon.py b/wagon.py index 43bca0a..b9c7164 100644 --- a/wagon.py +++ b/wagon.py @@ -39,11 +39,11 @@ try: import urllib.error from urllib.request import urlopen - from urllib.request import URLopener + from urllib.request import urlretrieve except ImportError: import urllib from urllib import urlopen - from urllib import URLopener + from urllib import urlretrieve try: from distro import linux_distribution @@ -320,8 +320,7 @@ def _download_file(url, destination): final_url = response.geturl() if final_url != url and is_verbose(): logger.debug('Redirected to %s', final_url) - f = URLopener() - f.retrieve(final_url, destination) + urlretrieve(final_url, destination) def _http_request(url):