diff --git a/apel/db/loader/record_factory.py b/apel/db/loader/record_factory.py index b93a534e..cc74f584 100644 --- a/apel/db/loader/record_factory.py +++ b/apel/db/loader/record_factory.py @@ -108,7 +108,7 @@ def create_records(self, msg_text): except KeyError: try: # Use the full header to distinguish normalised and non-norm summaries. - record_type = record_mapping[header] + record_type = record_mapping[header.strip()] except KeyError: raise RecordFactoryException('Message type %s not recognised.' % header) diff --git a/apel/db/unloader.py b/apel/db/unloader.py index fbd88ba0..31e87dff 100644 --- a/apel/db/unloader.py +++ b/apel/db/unloader.py @@ -272,7 +272,7 @@ def _write_apel(self, records): record_type = type(records[0]) buf = StringIO.StringIO() - buf.write(self.APEL_HEADERS[record_type] + ' \n') + buf.write(self.APEL_HEADERS[record_type] + '\n') buf.write('%%\n'.join( [ record.get_msg(self._withhold_dns) for record in records ] )) buf.write('%%\n')