[DEBUG] enc_source_file_path _shared/client_config/client_config_20160815215016.json.gz.enc, qa-cake-entities-us2
[DEBUG] len(source_file_contents) 8952
[DEBUG] key [238, 178, 35, 103, 233, 113, 252, 221, 182, 126, 120, 203, 69, 10, 19, 97]
[DEBUG] iv [218, 102, 216, 146, 223, 176, 183, 253, 180, 38, 44, 107, 76, 234, 38, 71]
[DEBUG] enc_config len(8784)
[DEBUG] config_file_contents_gz [:16] [162, 228, 50, 69, 199, 231, 1, 213, 27, 116, 98, 159, 94, 227, 101, 141]
[DEBUG] config_file_contents_gz [:16] b'\xa2\xe42E\xc7\xe7\x01\xd5\x1btb\x9f^\xe3e\x8d'
191
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-199-4ac0f0b6cbfe> in <module>()
86
87
---> 88 print(get_config())
89 # [DEBUG] enc_config b'\xbb\x979\xee\x8f&\xd7\x8eA>\x0bBw\x02
90 # \x89\x03\xe3\x94\x19\x0f\x86\x9f\x03\x7f['
<ipython-input-199-4ac0f0b6cbfe> in get_config(region_name, region_code)
25 print('[DEBUG] enc_config len({})'.format(len(enc_config)))
26
---> 27 config_file_contents = extract_config_file_contents(enc_config, key, iv)
28 print('[DEBUG] config_file_contents {}'.format(config_file_contents))
29 # return config_file_contents
<ipython-input-199-4ac0f0b6cbfe> in extract_config_file_contents(enc_config, key, iv)
59 with open("/Users/robert/Downloads/testing.gz", 'wb') as gzfile:
60 print(gzfile.write(config_file_contents_gz)) # writes an invalid gzip file
---> 61 config_file_contents = gzip.decompress(config_file_contents_gz)
62 print("[DEBUG] config_file_contents {}".format([b for b in config_file_contents]))
63 print("[DEBUG] config_file_contents {}".format(len([b for b in config_file_contents])))
/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/gzip.py in decompress(data)
528 """
529 with GzipFile(fileobj=io.BytesIO(data)) as f:
--> 530 return f.read()
531
532
/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/gzip.py in read(self, size)
272 import errno
273 raise OSError(errno.EBADF, "read() on write-only GzipFile object")
--> 274 return self._buffer.read(size)
275
276 def read1(self, size=-1):
/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/gzip.py in read(self, size)
459 # jump to the next member, if there is one.
460 self._init_read()
--> 461 if not self._read_gzip_header():
462 self._size = self._pos
463 return b""
/usr/local/Cellar/python3/3.5.2_1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/gzip.py in _read_gzip_header(self)
407
408 if magic != b'\037\213':
--> 409 raise OSError('Not a gzipped file (%r)' % magic)
410
411 (method, flag,
OSError: Not a gzipped file (b'\xa2\xe4')