amorin | frickler I did try to run tox with the env just like you pasted yes | 13:11 |
---|---|---|
amorin | as itamarst said, I dont believe it's what I need anyway. | 13:12 |
ralonsoh | hi folks, I'm trying to decode a request from a socket (I'm in the middle of the migration of the metadata proxy) | 14:56 |
ralonsoh | so the point is that I receive something so "beautiful" like this | 14:57 |
ralonsoh | https://paste.opendev.org/show/bltHaZrv97ZBOTJuttUF/ | 14:57 |
ralonsoh | what library can I use to decode this in an easy way? | 14:57 |
ralonsoh | hberaud[m], ^ | 15:26 |
frickler | ralonsoh: that looks like a plain str to me, not sure what you want to decode there? expand the newlines? then just use print()? | 15:40 |
ralonsoh | yeah, well, this is what I received in the socket file | 15:40 |
ralonsoh | what I need is something to parse this | 15:40 |
ralonsoh | better than doing this manually | 15:40 |
frickler | ah, so convert to a dict or similar? | 15:41 |
ralonsoh | well, more than this | 15:42 |
ralonsoh | something that takes this text and returns a request object | 15:42 |
ralonsoh | with the headers and all this stuff | 15:42 |
ralonsoh | data = self.request.recv(1024) | 15:49 |
ralonsoh | f = io.BytesIO(data) | 15:49 |
ralonsoh | f.readline() # read the request line | 15:49 |
ralonsoh | message = client.parse_headers(f) | 15:49 |
ralonsoh | done! | 15:49 |
ralonsoh | much much better than parsing (for sure in a horrible way) the message from the socket | 15:49 |
itamarst | ok made some progress I think | 17:02 |
itamarst | hberaud[m]: ready for review if you're working tomorrow | 19:14 |
hberaud[m] | itamarst: ack, thanks, I'll take a look tomorrow | 19:20 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!