question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error reading block blob from Python API

See original GitHub issue

Using 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
XiaoningLiucommented, May 10, 2019

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 return content-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 a ranges or x-ms-ranges headers which fits REST API spec. https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob

0reactions
efiopcommented, Jun 24, 2019

@XiaoningLiu Looking forward to it! 🎉 Thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found