[GH-ISSUE #159] [BUG] Range Reader returning wrong bytes #2175

Closed
opened 2026-03-15 17:52:47 +03:00 by kerem · 2 comments
Owner

Originally created by @ls-tommy-baloukas on GitHub (Jan 7, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/159

I am currently using the fakestorage package in my project to unit test my GCS code. It seems like calling NewRangeReader(ctx, offset, length) returns the wrong bytes depending on what I pass in as offset and length. For example, say I have a GCS Object that contains the following text: "Hello There!" and my goal is to read this file in chunks until the entire file is read, I would get get the following => "Hlotee" if I chunk the reads by 2 bytes starting from 0 to EOF.

I tested my code with a real GCS instance, and I get the correct data back after reading in chunks (2 byte size), so this seems to be related to the fakestorage package.

Originally created by @ls-tommy-baloukas on GitHub (Jan 7, 2020). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/159 I am currently using the fakestorage package in my project to unit test my GCS code. It seems like calling NewRangeReader(ctx, offset, length) returns the wrong bytes depending on what I pass in as offset and length. For example, say I have a GCS Object that contains the following text: "Hello There!" and my goal is to read this file in chunks until the entire file is read, I would get get the following => "Hlotee" if I chunk the reads by 2 bytes starting from 0 to EOF. I tested my code with a real GCS instance, and I get the correct data back after reading in chunks (2 byte size), so this seems to be related to the fakestorage package.
kerem 2026-03-15 17:52:47 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@fsouza commented on GitHub (Feb 6, 2020):

Hi @ls-tommy-baloukas, thanks for reporting and apologies for the delayed response. Let's fix this :)

Can you share a reproducer so we can use it as a test to prevent regressions?

<!-- gh-comment-id:583159724 --> @fsouza commented on GitHub (Feb 6, 2020): Hi @ls-tommy-baloukas, thanks for reporting and apologies for the delayed response. Let's fix this :) Can you share a reproducer so we can use it as a test to prevent regressions?
Author
Owner

@fsouza commented on GitHub (Feb 15, 2021):

Closing as stale.

<!-- gh-comment-id:779482649 --> @fsouza commented on GitHub (Feb 15, 2021): Closing as stale.
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#2175
No description provided.