Seeing the following results with azure.storage.blob version 12.0.0b2
In [4]: url = "https://bryan.blob.core.windows.net/julia/foo.py" + AZ_SAS_TOKEN
In [5]: bc = BlobClient(url)
In [6]: bc.download_blob().content_as_bytes()
Out[6]: b'class Foo:\n pass\n\n\nclass Bar:\n pass\n\n\nclass Baz(object):\n pass\n'
In [7]: bc.download_blob(offset=0, length=5).content_as_bytes()
Out[7]: b'class '
In [8]: bc.download_blob(offset=5, length=5).content_as_bytes()
Out[8]: b' '
Noting the following unexpected behavior:
- The first case with
offset=0, length=5 returns b'class ' which has length 6
- The second case with
offset=5, length=5 only returns one byte even though there are more than 5 bytes left in the file at that offset
Also there is a typo in the ValueError raised when a length is given without an offset:
raise ValueError("Offset value must not be None is length is set.")
I think that is meant to be "IF length is set" (or perhaps "when length is set")
cc @annatisch @rakshith91 @xiafu-msft @zezha-msft
Seeing the following results with azure.storage.blob version 12.0.0b2
Noting the following unexpected behavior:
offset=0, length=5returnsb'class 'which has length 6offset=5, length=5only returns one byte even though there are more than 5 bytes left in the file at that offsetAlso there is a typo in the ValueError raised when a length is given without an offset:
I think that is meant to be "IF length is set" (or perhaps "when length is set")
cc @annatisch @rakshith91 @xiafu-msft @zezha-msft