[PR #1036] [MERGED] Fix custom-time error #1135

Closed
opened 2026-03-03 12:33:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/1036
Author: @RachitSharma2001
Created: 1/9/2023
Status: Merged
Merged: 1/9/2023
Merged by: @fsouza

Base: mainHead: fix-custom-time-error


📝 Commits (1)

📊 Changes

6 files changed (+91 additions, -35 deletions)

View changed files

📝 fakestorage/object.go (+33 -35)
📝 fakestorage/object_test.go (+41 -0)
📝 fakestorage/response.go (+2 -0)
📝 fakestorage/upload.go (+8 -0)
📝 fakestorage/upload_test.go (+6 -0)
📝 internal/backend/object.go (+1 -0)

📄 Description

Fixes https://github.com/fsouza/fake-gcs-server/issues/410.

If I now run the following python script:

self.client = storage.Client()
self.bucket = self.client.get_bucket(bucket_name)

blob = self.bucket.blob(blob_name)
blob.upload_from_string(value, content_type=content_type)
blob.reload()
blob.custom_time = datetime.datetime.now(datetime.timezone.utc)
blob.patch()
blob = self.bucket.get_blob(blob_name)
print(blob.custom_time)

It now does not print None but rather prints the correct time.

Let me know if there is anything I should change or add. One thing I was unsure of is that in fakestorage/object.go, I did not make any changes to UpdateObject, so it still only updates metadata rather than any other attributes like CustomTime or Acl (unlike the PatchObject method). Let me know if UpdateObject should be similarly changed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/1036 **Author:** [@RachitSharma2001](https://github.com/RachitSharma2001) **Created:** 1/9/2023 **Status:** ✅ Merged **Merged:** 1/9/2023 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `fix-custom-time-error` --- ### 📝 Commits (1) - [`e33baea`](https://github.com/fsouza/fake-gcs-server/commit/e33baeac33746f5518a8f6f8fe51cadf3bceb5c7) Fix custom-time error ### 📊 Changes **6 files changed** (+91 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/object.go` (+33 -35) 📝 `fakestorage/object_test.go` (+41 -0) 📝 `fakestorage/response.go` (+2 -0) 📝 `fakestorage/upload.go` (+8 -0) 📝 `fakestorage/upload_test.go` (+6 -0) 📝 `internal/backend/object.go` (+1 -0) </details> ### 📄 Description Fixes https://github.com/fsouza/fake-gcs-server/issues/410. If I now run the following python script: ``` self.client = storage.Client() self.bucket = self.client.get_bucket(bucket_name) blob = self.bucket.blob(blob_name) blob.upload_from_string(value, content_type=content_type) blob.reload() blob.custom_time = datetime.datetime.now(datetime.timezone.utc) blob.patch() blob = self.bucket.get_blob(blob_name) print(blob.custom_time) ``` It now does not print `None` but rather prints the correct time. Let me know if there is anything I should change or add. One thing I was unsure of is that in `fakestorage/object.go`, I did not make any changes to `UpdateObject`, so it still only updates metadata rather than any other attributes like `CustomTime` or `Acl` (unlike the `PatchObject` method). Let me know if `UpdateObject` should be similarly changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:33:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#1135
No description provided.