Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-storages for openSUSE:Factory checked in at 2022-05-12 23:00:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-storages (Old) and /work/SRC/openSUSE:Factory/.python-django-storages.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-storages" Thu May 12 23:00:44 2022 rev:9 rq:976562 version:1.12.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-storages/python-django-storages.changes 2021-10-16 22:47:34.320688469 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-storages.new.1538/python-django-storages.changes 2022-05-12 23:01:15.748869476 +0200 @@ -1,0 +2,22 @@ +Thu May 12 07:05:15 UTC 2022 - pgaj...@suse.com + +- version update to 1.12.3 + General + ------- + - Add support for Python 3.10 (`#1078`_) + S3 + -- + - Re-raise non-404 errors in ``.exists()`` (`#1084`_, `#1085`_) + Azure + ----- + - Fix using ``AZURE_CUSTOM_DOMAIN`` with an account key credential (`#1082`_, `#1083`_) + SFTP + ---- + - Catch ``FileNotFoundError`` instead of ``OSerror`` in ``.exists()`` to prevent swallowing ``socket.timeout`` exceptions (`#1064`_, `#1087`_) + Azure + ----- + - Add ``parameters`` kwarg to ``AzureStorage.url`` to configure blob properties in the SAS token (`#1071`_) + - Fix regression where ``AZURE_CUSTOM_DOMAIN`` was interpreted as a replacement of ``blob.core.windows.net`` rather than as a full domain + (`#1073`_, `#1076`_) + +------------------------------------------------------------------- Old: ---- django-storages-1.12.1.tar.gz New: ---- django-storages-1.12.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-storages.spec ++++++ --- /var/tmp/diff_new_pack.DlBeqJ/_old 2022-05-12 23:01:16.244870142 +0200 +++ /var/tmp/diff_new_pack.DlBeqJ/_new 2022-05-12 23:01:16.248870147 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-django-storages # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %define skip_python2 1 %bcond_without python2 Name: python-django-storages -Version: 1.12.1 +Version: 1.12.3 Release: 0 Summary: Support for many storage backends in Django License: BSD-3-Clause ++++++ django-storages-1.12.1.tar.gz -> django-storages-1.12.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/CHANGELOG.rst new/django-storages-1.12.3/CHANGELOG.rst --- old/django-storages-1.12.1/CHANGELOG.rst 2021-10-11 20:12:04.000000000 +0200 +++ new/django-storages-1.12.3/CHANGELOG.rst 2021-10-30 04:34:06.000000000 +0200 @@ -1,6 +1,52 @@ django-storages CHANGELOG ========================= +1.12.3 (2021-10-29) +******************* + +General +------- + +- Add support for Python 3.10 (`#1078`_) + +S3 +-- + +- Re-raise non-404 errors in ``.exists()`` (`#1084`_, `#1085`_) + +Azure +----- + +- Fix using ``AZURE_CUSTOM_DOMAIN`` with an account key credential (`#1082`_, `#1083`_) + +SFTP +---- + +- Catch ``FileNotFoundError`` instead of ``OSerror`` in ``.exists()`` to prevent swallowing ``socket.timeout`` exceptions (`#1064`_, `#1087`_) + + +.. _#1078: https://github.com/jschneier/django-storages/pull/1078 +.. _#1084: https://github.com/jschneier/django-storages/issues/1084 +.. _#1085: https://github.com/jschneier/django-storages/pull/1085 +.. _#1082: https://github.com/jschneier/django-storages/issues/1082 +.. _#1083: https://github.com/jschneier/django-storages/pull/1083 +.. _#1064: https://github.com/jschneier/django-storages/issues/1064 +.. _#1087: https://github.com/jschneier/django-storages/pull/1087 + +1.12.2 (2021-10-16) +******************* + +Azure +----- + +- Add ``parameters`` kwarg to ``AzureStorage.url`` to configure blob properties in the SAS token (`#1071`_) +- Fix regression where ``AZURE_CUSTOM_DOMAIN`` was interpreted as a replacement of ``blob.core.windows.net`` rather than as a full domain + (`#1073`_, `#1076`_) + +.. _#1071: https://github.com/jschneier/django-storages/pull/1071 +.. _#1073: https://github.com/jschneier/django-storages/issues/1073 +.. _#1076: https://github.com/jschneier/django-storages/pull/1076 + 1.12.1 (2021-10-11) ******************* @@ -10,17 +56,18 @@ - Change gzip compression to use a streaming implementation (`#1061`_) - Fix saving files with ``S3ManifestStaticStorage`` (`#1068`_, `#1069`_) -.. _#1061: https://github.com/jschneier/django-storages/pull/1003 +.. _#1061: https://github.com/jschneier/django-storages/pull/1061 .. _#1068: https://github.com/jschneier/django-storages/issues/1068 .. _#1069: https://github.com/jschneier/django-storages/pull/1069 1.12 (2021-10-06) ***************** +General +------- - Add support for Django 3.2 (`#1046`_, `#1042`_, `#1005`_) - Replace Travis CI with GitHub actions (`#1051`_) - S3 -- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/PKG-INFO new/django-storages-1.12.3/PKG-INFO --- old/django-storages-1.12.1/PKG-INFO 2021-10-11 20:12:46.954153800 +0200 +++ new/django-storages-1.12.3/PKG-INFO 2021-10-30 04:34:31.238307700 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-storages -Version: 1.12.1 +Version: 1.12.3 Summary: Support for many storage backends in Django Home-page: https://github.com/jschneier/django-storages Author: Josh Schneier @@ -118,6 +118,52 @@ django-storages CHANGELOG ========================= + 1.12.3 (2021-10-29) + ******************* + + General + ------- + + - Add support for Python 3.10 (`#1078`_) + + S3 + -- + + - Re-raise non-404 errors in ``.exists()`` (`#1084`_, `#1085`_) + + Azure + ----- + + - Fix using ``AZURE_CUSTOM_DOMAIN`` with an account key credential (`#1082`_, `#1083`_) + + SFTP + ---- + + - Catch ``FileNotFoundError`` instead of ``OSerror`` in ``.exists()`` to prevent swallowing ``socket.timeout`` exceptions (`#1064`_, `#1087`_) + + + .. _#1078: https://github.com/jschneier/django-storages/pull/1078 + .. _#1084: https://github.com/jschneier/django-storages/issues/1084 + .. _#1085: https://github.com/jschneier/django-storages/pull/1085 + .. _#1082: https://github.com/jschneier/django-storages/issues/1082 + .. _#1083: https://github.com/jschneier/django-storages/pull/1083 + .. _#1064: https://github.com/jschneier/django-storages/issues/1064 + .. _#1087: https://github.com/jschneier/django-storages/pull/1087 + + 1.12.2 (2021-10-16) + ******************* + + Azure + ----- + + - Add ``parameters`` kwarg to ``AzureStorage.url`` to configure blob properties in the SAS token (`#1071`_) + - Fix regression where ``AZURE_CUSTOM_DOMAIN`` was interpreted as a replacement of ``blob.core.windows.net`` rather than as a full domain + (`#1073`_, `#1076`_) + + .. _#1071: https://github.com/jschneier/django-storages/pull/1071 + .. _#1073: https://github.com/jschneier/django-storages/issues/1073 + .. _#1076: https://github.com/jschneier/django-storages/pull/1076 + 1.12.1 (2021-10-11) ******************* @@ -127,17 +173,18 @@ - Change gzip compression to use a streaming implementation (`#1061`_) - Fix saving files with ``S3ManifestStaticStorage`` (`#1068`_, `#1069`_) - .. _#1061: https://github.com/jschneier/django-storages/pull/1003 + .. _#1061: https://github.com/jschneier/django-storages/pull/1061 .. _#1068: https://github.com/jschneier/django-storages/issues/1068 .. _#1069: https://github.com/jschneier/django-storages/pull/1069 1.12 (2021-10-06) ***************** + General + ------- - Add support for Django 3.2 (`#1046`_, `#1042`_, `#1005`_) - Replace Travis CI with GitHub actions (`#1051`_) - S3 -- @@ -1105,6 +1152,7 @@ Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Requires-Python: >=3.5 Provides-Extra: azure Provides-Extra: boto3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/django_storages.egg-info/PKG-INFO new/django-storages-1.12.3/django_storages.egg-info/PKG-INFO --- old/django-storages-1.12.1/django_storages.egg-info/PKG-INFO 2021-10-11 20:12:46.000000000 +0200 +++ new/django-storages-1.12.3/django_storages.egg-info/PKG-INFO 2021-10-30 04:34:31.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: django-storages -Version: 1.12.1 +Version: 1.12.3 Summary: Support for many storage backends in Django Home-page: https://github.com/jschneier/django-storages Author: Josh Schneier @@ -118,6 +118,52 @@ django-storages CHANGELOG ========================= + 1.12.3 (2021-10-29) + ******************* + + General + ------- + + - Add support for Python 3.10 (`#1078`_) + + S3 + -- + + - Re-raise non-404 errors in ``.exists()`` (`#1084`_, `#1085`_) + + Azure + ----- + + - Fix using ``AZURE_CUSTOM_DOMAIN`` with an account key credential (`#1082`_, `#1083`_) + + SFTP + ---- + + - Catch ``FileNotFoundError`` instead of ``OSerror`` in ``.exists()`` to prevent swallowing ``socket.timeout`` exceptions (`#1064`_, `#1087`_) + + + .. _#1078: https://github.com/jschneier/django-storages/pull/1078 + .. _#1084: https://github.com/jschneier/django-storages/issues/1084 + .. _#1085: https://github.com/jschneier/django-storages/pull/1085 + .. _#1082: https://github.com/jschneier/django-storages/issues/1082 + .. _#1083: https://github.com/jschneier/django-storages/pull/1083 + .. _#1064: https://github.com/jschneier/django-storages/issues/1064 + .. _#1087: https://github.com/jschneier/django-storages/pull/1087 + + 1.12.2 (2021-10-16) + ******************* + + Azure + ----- + + - Add ``parameters`` kwarg to ``AzureStorage.url`` to configure blob properties in the SAS token (`#1071`_) + - Fix regression where ``AZURE_CUSTOM_DOMAIN`` was interpreted as a replacement of ``blob.core.windows.net`` rather than as a full domain + (`#1073`_, `#1076`_) + + .. _#1071: https://github.com/jschneier/django-storages/pull/1071 + .. _#1073: https://github.com/jschneier/django-storages/issues/1073 + .. _#1076: https://github.com/jschneier/django-storages/pull/1076 + 1.12.1 (2021-10-11) ******************* @@ -127,17 +173,18 @@ - Change gzip compression to use a streaming implementation (`#1061`_) - Fix saving files with ``S3ManifestStaticStorage`` (`#1068`_, `#1069`_) - .. _#1061: https://github.com/jschneier/django-storages/pull/1003 + .. _#1061: https://github.com/jschneier/django-storages/pull/1061 .. _#1068: https://github.com/jschneier/django-storages/issues/1068 .. _#1069: https://github.com/jschneier/django-storages/pull/1069 1.12 (2021-10-06) ***************** + General + ------- - Add support for Django 3.2 (`#1046`_, `#1042`_, `#1005`_) - Replace Travis CI with GitHub actions (`#1051`_) - S3 -- @@ -1105,6 +1152,7 @@ Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Requires-Python: >=3.5 Provides-Extra: azure Provides-Extra: boto3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/docs/backends/azure.rst new/django-storages-1.12.3/docs/backends/azure.rst --- old/django-storages-1.12.1/docs/backends/azure.rst 2021-10-03 22:18:31.000000000 +0200 +++ new/django-storages-1.12.3/docs/backends/azure.rst 2021-10-16 07:29:34.000000000 +0200 @@ -61,6 +61,20 @@ DEFAULT_FILE_STORAGE = 'storages.backends.azure_storage.AzureStorage' STATICFILES_STORAGE = 'custom_storage.custom_azure.PublicAzureStorage' ++++++++++++++++++++++ +Private VS Public URL ++++++++++++++++++++++ + +The difference between public and private URLs is that private includes the SAS token. +With private URLs you can override certain properties stored for the blob by specifying +query parameters as part of the shared access signature. These properties include the +cache-control, content-type, content-encoding, content-language, and content-disposition. +See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties#remarks + +You can specify these parameters by:: + az_storage = AzureStorage() + az_url = az_storage.url(blob_name, parameters={'content_type': 'text/html;'}) + Settings ******** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/setup.cfg new/django-storages-1.12.3/setup.cfg --- old/django-storages-1.12.1/setup.cfg 2021-10-11 20:12:46.955506300 +0200 +++ new/django-storages-1.12.3/setup.cfg 2021-10-30 04:34:31.239311500 +0200 @@ -26,6 +26,7 @@ Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 [options] zip_safe = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/storages/__init__.py new/django-storages-1.12.3/storages/__init__.py --- old/django-storages-1.12.1/storages/__init__.py 2021-10-11 20:12:04.000000000 +0200 +++ new/django-storages-1.12.3/storages/__init__.py 2021-10-30 04:34:06.000000000 +0200 @@ -1 +1 @@ -__version__ = '1.12.1' +__version__ = '1.12.3' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/storages/backends/azure_storage.py new/django-storages-1.12.3/storages/backends/azure_storage.py --- old/django-storages-1.12.1/storages/backends/azure_storage.py 2021-10-07 03:54:29.000000000 +0200 +++ new/django-storages-1.12.3/storages/backends/azure_storage.py 2021-10-30 04:17:16.000000000 +0200 @@ -151,13 +151,17 @@ if self.connection_string is not None: return BlobServiceClient.from_connection_string(self.connection_string) - account_domain = self.custom_domain or "blob.core.windows.net" - account_url = "{}://{}.{}".format( - self.azure_protocol, self.account_name, account_domain + account_domain = self.custom_domain or "{}.blob.core.windows.net".format( + self.account_name ) + account_url = "{}://{}".format(self.azure_protocol, account_domain) + credential = None if self.account_key: - credential = self.account_key + credential = { + "account_name": self.account_name, + "account_key": self.account_key, + } elif self.sas_token: credential = self.sas_token elif self.token_credential: @@ -275,8 +279,9 @@ # azure expects time in UTC return datetime.utcnow() + timedelta(seconds=expire) - def url(self, name, expire=None): + def url(self, name, expire=None, parameters=None): name = self._get_valid_path(name) + params = parameters or {} if expire is None: expire = self.expiration_secs @@ -292,7 +297,9 @@ account_key=self.account_key, user_delegation_key=user_delegation_key, permission=BlobSasPermissions(read=True), - expiry=expiry) + expiry=expiry, + **params + ) credential = sas_token container_blob_url = self.client.get_blob_client(name).url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/storages/backends/s3boto3.py new/django-storages-1.12.3/storages/backends/s3boto3.py --- old/django-storages-1.12.1/storages/backends/s3boto3.py 2021-10-11 20:07:13.000000000 +0200 +++ new/django-storages-1.12.3/storages/backends/s3boto3.py 2021-10-30 04:08:09.000000000 +0200 @@ -469,18 +469,15 @@ self.connection.meta.client.head_object(Bucket=self.bucket_name, Key=name) return True except ClientError as error: - if error.response.get('Error', {}).get('Code') == '404': + if error.response['ResponseMetadata']['HTTPStatusCode'] == 404: return False - # Some other error was encountered. As `get_available_name` calls this, - # we have to assume the filename is unavailable. If we return true due to some - # other error, we'd overwrite a file. - return True + # Some other error was encountered. Re-raise it. + raise def listdir(self, name): path = self._normalize_name(self._clean_name(name)) - # The path needs to end with a slash, but if the root is empty, leave - # it. + # The path needs to end with a slash, but if the root is empty, leave it. if path and not path.endswith('/'): path += '/' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/storages/backends/sftpstorage.py new/django-storages-1.12.3/storages/backends/sftpstorage.py --- old/django-storages-1.12.1/storages/backends/sftpstorage.py 2021-09-12 02:16:29.000000000 +0200 +++ new/django-storages-1.12.3/storages/backends/sftpstorage.py 2021-10-30 04:17:16.000000000 +0200 @@ -150,7 +150,7 @@ try: self.sftp.stat(self._remote_path(name)) return True - except OSError: + except FileNotFoundError: return False def _isdir_attr(self, item): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/tests/test_azure.py new/django-storages-1.12.3/tests/test_azure.py --- old/django-storages-1.12.1/tests/test_azure.py 2021-10-07 03:54:29.000000000 +0200 +++ new/django-storages-1.12.3/tests/test_azure.py 2021-10-30 04:17:16.000000000 +0200 @@ -231,8 +231,8 @@ bsc_mocked.return_value.get_container_client.return_value = client_mock self.assertEqual(storage.client, client_mock) bsc_mocked.assert_called_once_with( - 'https://foo_name.foo_domain', - credential='foo_key') + 'https://foo_domain', + credential={'account_name': 'foo_name', 'account_key': 'foo_key'}) def test_container_client_params_sas_token(self): storage = azure_storage.AzureStorage() @@ -247,7 +247,7 @@ bsc_mocked.return_value.get_container_client.return_value = client_mock self.assertEqual(storage.client, client_mock) bsc_mocked.assert_called_once_with( - 'http://foo_name.foo_domain', + 'http://foo_domain', credential='foo_token') def test_container_client_params_token_credential(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/tests/test_s3boto3.py new/django-storages-1.12.3/tests/test_s3boto3.py --- old/django-storages-1.12.1/tests/test_s3boto3.py 2021-10-11 20:07:13.000000000 +0200 +++ new/django-storages-1.12.3/tests/test_s3boto3.py 2021-10-30 04:08:09.000000000 +0200 @@ -488,15 +488,25 @@ def test_storage_exists_false(self): self.storage.connection.meta.client.head_object.side_effect = ClientError( - {'Error': {'Code': '404', 'Message': 'Not Found'}}, + {'Error': {}, 'ResponseMetadata': {'HTTPStatusCode': 404}}, 'HeadObject', ) - self.assertFalse(self.storage.exists("file.txt")) + self.assertFalse(self.storage.exists('file.txt')) self.storage.connection.meta.client.head_object.assert_called_with( Bucket=self.storage.bucket_name, Key='file.txt', ) + def test_storage_exists_other_error_reraise(self): + self.storage.connection.meta.client.head_object.side_effect = ClientError( + {'Error': {}, 'ResponseMetadata': {'HTTPStatusCode': 403}}, + 'HeadObject', + ) + with self.assertRaises(ClientError) as cm: + self.storage.exists('file.txt') + + self.assertEqual(cm.exception.response['ResponseMetadata']['HTTPStatusCode'], 403) + def test_storage_delete(self): self.storage.delete("path/to/file.txt") self.storage.bucket.Object.assert_called_with('path/to/file.txt') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-storages-1.12.1/tests/test_sftp.py new/django-storages-1.12.3/tests/test_sftp.py --- old/django-storages-1.12.1/tests/test_sftp.py 2021-09-12 02:16:29.000000000 +0200 +++ new/django-storages-1.12.3/tests/test_sftp.py 2021-10-30 04:17:16.000000000 +0200 @@ -1,5 +1,6 @@ import io import os +import socket import stat from datetime import datetime from unittest.mock import MagicMock, patch @@ -56,7 +57,7 @@ self.assertEqual(mock_sftp.mkdir.call_args[0], ('foo',)) @patch('storages.backends.sftpstorage.SFTPStorage.sftp', **{ - 'stat.side_effect': (IOError(), True) + 'stat.side_effect': (FileNotFoundError(), True) }) def test_mkdir_parent(self, mock_sftp): self.storage._mkdir('bar/foo') @@ -69,7 +70,7 @@ self.assertTrue(mock_sftp.open.return_value.write.called) @patch('storages.backends.sftpstorage.SFTPStorage.sftp', **{ - 'stat.side_effect': (IOError(), True) + 'stat.side_effect': (FileNotFoundError(), True) }) def test_save_in_subdir(self, mock_sftp): self.storage._save('bar/foo', File(io.BytesIO(b'foo'), 'foo')) @@ -86,12 +87,19 @@ self.assertTrue(self.storage.exists('foo')) @patch('storages.backends.sftpstorage.SFTPStorage.sftp', **{ - 'stat.side_effect': IOError() + 'stat.side_effect': FileNotFoundError() }) def test_not_exists(self, mock_sftp): self.assertFalse(self.storage.exists('foo')) @patch('storages.backends.sftpstorage.SFTPStorage.sftp', **{ + 'stat.side_effect': socket.timeout() + }) + def test_not_exists_timeout(self, mock_sftp): + with self.assertRaises(socket.timeout): + self.storage.exists('foo') + + @patch('storages.backends.sftpstorage.SFTPStorage.sftp', **{ 'listdir_attr.return_value': [MagicMock(filename='foo', st_mode=stat.S_IFDIR), MagicMock(filename='bar', st_mode=None)]})