You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 31, 2026. It is now read-only.
Storage: Possible metadata regression on blobs in 1.24.0 #15
It's documented that metadata that isn't set will return a NoneType. Naturally, when wanting to unset any metadata, you expect to be able to pass in None. This worked up until 1.24.0 which broke this with googleapis/google-cloud-python#9796.
I think you can still technically set the metadata to an empty dictionary and get the same functionality, but it's a bit counter intuitive, when no metadata is described as being a NoneType.
AttributeError: 'NoneType' object has no attribute 'items'
File "django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "rest_framework/views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "rest_framework/views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "rest_framework/views.py", line 476, in raise_uncaught_exception
raise exc
File "rest_framework/views.py", line 502, in dispatch
response = handler(request, *args, **kwargs)
File "api/media/views.py", line 96, in put
product.media.set_primary(name)
File "media/api.py", line 134, in set_primary
blob.metadata = None
File "/usr/local/lib/python3.7/site-packages/google/cloud/storage/blob.py", line 1917, in metadata
value = {k: str(v) for k, v in value.items()}
Activity