Problem:
Loading .sample files created under Windows fails under Linux due to different line endings ('\n' created in Windows becomes '\r\n' under Linux)
Suggested solution:
Do not include '\n' in the split delimiter. Instead, strip the remaining string afterwards and replace '\r\n' by '\n' to enable the pickle package to work with it:
pickle.loads(filehandle.read().split('<PICKLE PACKET BEGINS HERE>')[1].strip().replace('\r\n', '\n'))
Problem: Loading .sample files created under Windows fails under Linux due to different line endings ('\n' created in Windows becomes '\r\n' under Linux)
Relevant line of code: https://github.com/qkitgroup/qkit/blob/4f84bc7dc8089e3a674b4dd558d7e340af4d9797/qkit/measure/samples_class.py#L104
Suggested solution: Do not include '\n' in the split delimiter. Instead, strip the remaining string afterwards and replace '\r\n' by '\n' to enable the pickle package to work with it:
pickle.loads(filehandle.read().split('<PICKLE PACKET BEGINS HERE>')[1].strip().replace('\r\n', '\n'))