[Answered ]-Python header unicode to dict

2👍

As had already been pointed out in a deleted answer, your problem are the entries

'wsgi.input': <socket._fileobject object at 0x112519cd0>
'wsgi.errors': <open file '<stderr>', mode 'w' at 0x10f4891e0>
'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x110994258>

Remove these and

ast.literal_eval(header_data)

should work.

👤jsfan

Leave a comment