diff --git a/pyaccuwage/__init__.py b/pyaccuwage/__init__.py index d438817..3db24fc 100644 --- a/pyaccuwage/__init__.py +++ b/pyaccuwage/__init__.py @@ -58,6 +58,8 @@ def loads(s, record_types=get_record_types()): def dump(fp, records, delim=None): + if type(delim) is str: + delim = delim.encode('ascii') for r in records: fp.write(r.output()) if delim: diff --git a/tests/test_records.py b/tests/test_records.py index dfa25fa..166b6d5 100644 --- a/tests/test_records.py +++ b/tests/test_records.py @@ -90,7 +90,8 @@ class TestFileFormats(unittest.TestCase): record_identifier = 'B' # 1 byte zero1 = ZeroField(max_length=32) text1 = TextField(max_length=71) - blank2 = BlankField(max_length=24) + text2 = TextField(max_length=20) + blank2 = BlankField(max_length=4) record_types = [TestModelA, TestModelB]