-
-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure streaming binary data error #716
Comments
Can you poke around with a debugger?
I don't see int() in the stack trace anywhere... I wonder what's actually raising that exception. |
It looks like it's something to do with how For example: >>> import os
>>> data = os.urandom(32)
>>> data
b"\xaf\xc6\x89\xc4xt2s'_\xc5\xd3\xb1\xe9\x86\xa5&\x80\xf2!\x96q\xff\xbc\x81?\xc4\x8e\x14q\xe9E"
>>> len(data)
32 |
I don't see any |
I think the Python built-in function def len(*args, **kwargs): # real signature unknown
""" Return the number of items in a container. """
pass This means we won't see It guess when calling
|
For what possible values of If you're able to dig in with a debugger, it would be good to know what those values are. |
I believe this is an issue under the hood with the |
I ran the script using the PyCharm debugger. Here are the values of the variables when the exception occurs: # type: numpy.ndarray
b = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0, 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0, 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] # type: bytes
data = b'\x00\x00\x00\x00\x00\xf05\xbf\x00\x00\x00\x00.... (lots of binary data) This is the traceback:
This is the code in def readinto(self, b):
"""Read up to len(b) bytes into b, and return the number of bytes read."""
data = self.read(len(b))
if not data:
return 0
b[:len(data)] = data
return len(data) Please note I've updated the package versions like so: (Conda name: my_env
channels:
- conda-forge
- defaults
dependencies:
- ca-certificates=2022.9.14=h5b45459_0
- certifi=2022.9.14=pyhd8ed1ab_0
- nptdms=1.6.0=pyhd8ed1ab_0
- smart-open=6.2.0=pyh1a96a4e_0
- smart_open=6.2.0=pyha770c72_0 |
Problem description
I am trying to stream a binary file from Azure Blob Storage.
I expect to be able to iterate over chunks of the data set, but I see an error do with the Azure
readinto
function.I'm using the npTDMS library to read a LabVIEW data file in TDMS format (binary quantitative data files.)
Steps/code to reproduce the problem
The code is something like this:
and the error I get is:
It seems like it's expecting a text file? Or it's not calculating the data index correctly to page through the data set?
Versions
From
pip list
:The text was updated successfully, but these errors were encountered: