If a client makes a request to a static resource with a range header (for example) of 400-400 (valid HTTP), this iterator will fail at this point. It is better to check the block size here, as we would still want to raise other errors at this point.
Handle the case where an empty range is requested
This looks good! Could I tweak you into adding a test for the case?
Err now that I look at the code in context, it doesn't appear that Pyramid itself creates a FileIter with anything other than a fixed _BLOCK_SIZE of 256K. Under what circumstance will self.block_size be 0?
FYI, I'm going to close this in about a week or so without OP response.
There may be an issue with handling an empty range, but I can't imagine that it is in FileIter. As @mcdonc already pointed out, there's nowhere in pyramid that modifies the block size.
Closing this issue until a valid test case pops up demonstrating that a range request actually fails.