-
Notifications
You must be signed in to change notification settings - Fork 200
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
Inconsistent exceptions when adding empty byte strings #137
Comments
I can confirm that in Python 3.7.0 attempting to store an empty bytearray throws a
|
Thanks for the sanity check @ibnesayeed, as I thought that maybe Py2 was the scapegoat. Are you able to see |
No, I never got |
Thanks for the feedback everybody! Turns out the root cause of this issue is likely the same as that of #104: Our broken HTTP multipart streaming backend. I come to this conclusion, because I found that the failing function received the following result from the deamon: [
{'Name': 'bytes', 'Hash': 'QmaRwA91m9Rdfaq9u3FH1fdMVxw1wFPjKL38czkWMxh3KB', 'Size': '8'},
{'Message': 'multipart: NextPart: EOF', 'Code': 0, 'Type': 'error'}
] However the function only expects: {'Name': 'bytes', 'Hash': 'QmaRwA91m9Rdfaq9u3FH1fdMVxw1wFPjKL38czkWMxh3KB', 'Size': '8'} from which it would then take the string-index The connection error is likely a result of the HTTP connection ending up in an undefined state after having received broken multipart data (the second message). |
Turns out it's actually a bug with go-IPFS: ipfs/kubo#5168 |
I don't get this error anymore with go-IPFS v0.4.18 – can somebody confirm that this is fixed? |
I can confirm that it is working fine with go-IPFS v0.4.18. This ticket can perhaps be closed now.
|
Tested in both Python 2 and 3 with success. |
Thank you! 👍 |
I am encountering an issue when adding strings of 0 length using
add_bytes(bytes(''))
(in oduwsdl/ipwb#485).Replication:
...but sometimes from this same line with the same empty string I get:
Is it in violation to add an empty string "as bytes" to IPFS using
add_bytes()
? Any clue why I would be getting multiple errors from the same line (replicable in interactive Python, too)?ipfsapi 0.4.3 (originally experienced in 0.4.2a)
The text was updated successfully, but these errors were encountered: