line 219 in elasticsearch/client/__init__.py (bytes error)
See original GitHub issueThis line is
def _bulk_body(self, body):
# if not passed in a string, serialize items and join by newline
if not isinstance(body, string_types):
body = '\n'.join(map(self.transport.serializer.dumps, body))
# bulk body must end with a newline
if not body.endswith('\n'):
body += '\n'
return body
In the section checking for the \n endswith only accepts bytes so this needs to be b’\n’.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Bytes message argument error - python - Stack Overflow
bytes () in Python 2.x is the same as str() and it accepts only one string argument. Use just message = "Message" and...
Read more >What is bytes.decode() in Python? - Educative.io
Line 5: We call the decode() method with utf-8 encoding scheme and strict as error handler to transform from encoded values to a...
Read more >struct — Interpret bytes as packed binary data — Python 3.11 ...
When packing a value x using one of the integer formats ( 'b' , 'B' , 'h' , 'H' , 'i' , 'I'...
Read more >How to convert Python string to bytes? | Flexiple Tutorials
The bytes() method is an inbuilt function that can be used to convert objects to byte objects. Syntax of bytes(): bytes(str, enc, error)....
Read more >Python bytes() method - GeeksforGeeks
enc : The encoding required in case object is a string; err : Way to handle error in case the string conversion fails....
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
I think you may have wanted to tag @danielmitterdorfer?
Thanks for the feedback. Unfortunately I am swamped with work at the moment so it might take a while until I get to it. I can keep an eye on the issue though and can look into submitting a PR when things get more quiet again.