>>> first_message
"\x1f�\x08\x00\x00\x00\x00\x00\x00\x00��Qo�0\x10ǿ����8NH@!UרS�N����/�\x05V�D0;�����\x06´\x17ʃuw���g����SI�\nL����G��2�\x17�!�o��dE�AY�ԕ��\x1fe��f��5 q��D�X��5M3ţ,�9���4�'\x06�\x05�[sܻ|v�>mEaef#�IvT�u\t�,z��\x1aa�\x13�#\x08�\x1aN\x12�3\r\x11�q\x08�I��k�_,���嘗�+��2F\x1eԐ�\x1a�IA\x16�c�\x00��`,�\x15r\x05\x03\x04��0�[�r��#\U0010f944��\n���\x7f�q��:��)�a�5�trt�0�x0�Ą\x07)���y���\x0f\x02�>�ݠ�n�6k\x1b\x13[�\x12�+\x14��şv\t%�~Ye0�\x1627r\x12��\x05wۈz�ǹX\n\x07J\x13\x02E�\x1e�\t\x1e�#g�\x07��K���1&����\\��/:�v\x04�������{�NI��չ\x08�\x08�wq�֝SR߶�v\x17oq\x12�(�����:�@\x16ѭ���(k�sU�g�'�.%n��uvkުvn����n���6\x7f\x01\x0c]q��\x04\x00\x00"
>>> first_message_bytes = bytes(first_message, 'utf-8')
>>> first_message_bytes
b"\x1f\xef\xbf\xbd\x08\x00\x00\x00\x00\x00\x00\x00\xef\xbf\xbd\xef\xbf\xbdQo\xef\xbf\xbd0\x10\xc7\xbf\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd8NH@!U\xd7\xa8S\xef\xbf\xbdN\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd/\xef\xbf\xbd\x05V\xef\xbf\xbdD0;\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x06\xc2\xb4\x17\xca\x83uw\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbdg\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbdSI\xef\xbf\xbd\nL\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xb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bd6\x7f\x01\x0c]q\xef\xbf\xbd\xef\xbf\xbd\x04\x00\x00">>> import zlib
>>> zlib.decompress(first_message_bytes, zlib.MAX_WBITS|32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: incorrect header check>>> zlib.decompress(first_message_bytes, zlib.MAX_WBITS|16)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
zlib.error: Error -3 while decompressing data: incorrect header check>>> import gzip, io
>>> gzip.GzipFile(fileobj=io.StringIO(first_message)).readlines()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/gzip.py", line 374, in readline
return self._buffer.readline(size)
File "/usr/local/lib/python3.7/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/usr/local/lib/python3.7/gzip.py", line 463, in read
if not self._read_gzip_header():
File "/usr/local/lib/python3.7/gzip.py", line 406, in _read_gzip_header
magic = self._fp.read(2)
File "/usr/local/lib/python3.7/gzip.py", line 91, in read
self.file.read(size-self._length+read)
TypeError: can't concat str to bytes>>> gzip.GzipFile(fileobj=io.BytesIO(first_message_bytes)).readlines()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/gzip.py", line 374, in readline
return self._buffer.readline(size)
File "/usr/local/lib/python3.7/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/usr/local/lib/python3.7/gzip.py", line 463, in read
if not self._read_gzip_header():
File "/usr/local/lib/python3.7/gzip.py", line 411, in _read_gzip_header
raise OSError('Not a gzipped file (%r)' % magic)
OSError: Not a gzipped file (b'\x1f\xef')------------------------------------------
Hack Partners Limited is a company registered in England and Wales. Registered Address: Hack Partners, WeWork Old St, 41 Corsham Street, London, N1 6DR. Registered Number: 9274301.
This e-mail, and any files transmitted with it, are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you have received this e-mail in error, please notify the sender by return and then destroy it.
The views and opinions expressed in this email are the author’s own and may not reflect the views and opinions of Hack Partners Limited.
This e-mail message has been scanned by antivirus software, however Hack Partners Limited cannot guarantee that it is virus free.
--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To post to this group, send email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Encoded into bytes, assuming `utf-8` encoding:>>> first_message_bytes = bytes(first_message, 'utf-8')
--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To post to this group, send email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.