Error reading block blob from Python API
See original GitHub issueUsing v3 blob service (running from source in docker), the following code throws an error:
from azure.storage.blob import BlockBlobService
blob_conn = BlockBlobService(is_emulated=True, custom_domain='localhost:10000')
blob_conn.create_container('azurite-test')
blob_conn.create_blob_from_text('azurite-test', 'test-file', 'Test content')
print(blob_conn.get_blob_to_text('azurite-test', 'test-file').content)
TypeError: '<' not supported between instances of 'int' and 'NoneType'
This code works with v2.7.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (12 by maintainers)
Top Results From Across the Web
error importing 'BlobServiceClient' from 'azure.storage.blob'
I was not able to reproduce it on PythonAnywhere. What I did was: pip3.7 install azure-storage-blob --user in the bash console and then...
Read more >Azure Blob Storage error codes - Microsoft Learn
Error code HTTP status code User message
BlobAlreadyExists Conflict (409) The specified blob already exists.
BlobNotFound Not Found (404) The specified blob does not exist.
ContainerAlreadyExists...
Read more >Reading and Writing an Azure Storage Blob from Python
Working with Azure Blob Storage is a common operation within a Python script or application. This blog post will show how to read...
Read more >Working with Azure Blob storage - Medium
Let's create a container in the storage account. Create a python file and start executing the following. First off, all the necessary imports....
Read more >sqlite3 — DB-API 2.0 interface for SQLite databases — Python ...
An Error (or subclass) exception will be raised if any further operation is attempted with the blob. read(length=- 1 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for debugging! That’s very interesting. I get the root cause.
For V3, when
GET BLOB
request requires to download the full blob, it doesn’t returncontent-range
header, which leads to Python SDK error. While other SDKs like Node.js or .Net doesn’t depend on this response header.We can fix this by always return
content-range
header when request includes aranges
orx-ms-ranges
headers which fits REST API spec. https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob@XiaoningLiu Looking forward to it! 🎉 Thank you!