Decompression errors
lijok opened this issue · 4 comments
lijok commented
Python 3.6
Every response with Content-Encoding gzip results in the following error
>>> from redfish import redfish_client
>>> server = redfish_client('http://192.168.200.216', 'redfish_admin', 'Redfish!')
>>> server.login(auth='session')
>>> schema = server.get('/redfish/v1/SchemaStore/en/ComputerSystem.json/')
Error occur while decompressing body: can't concat str to bytes
Traceback (most recent call last):
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\site-packages\redfish\rest\v1.py", line 795, in _r
est_request
restresp.text = decompressedfile.read()
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\gzip.py", line 276, in read
return self._buffer.read(size)
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\gzip.py", line 463, in read
if not self._read_gzip_header():
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\gzip.py", line 406, in _read_gzip_header
magic = self._fp.read(2)
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\gzip.py", line 91, in read
self.file.read(size-self._length+read)
TypeError: can't concat str to bytes
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\site-packages\redfish\rest\v1.py", line 578, in ge
t
headers=headers)
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\site-packages\redfish\rest\v1.py", line 964, in _r
est_request
args=args, body=body, headers=headers)
File "C:\Users\gecase\AppData\Local\Programs\Python\Python37-32\lib\site-packages\redfish\rest\v1.py", line 799, in _r
est_request
raise DecompressResponseError()
redfish.rest.v1.DecompressResponseError
billdodd commented
billdodd commented
Great! Thanks for testing the fix.
The code in the master branch should be updated with the fix during our next tools meeting on November 29.
mraineri commented
Reopening until the PR is merged to master so others are aware; thanks for confirming the fix!