Skip to content
This repository was archived by the owner on Dec 26, 2025. It is now read-only.

Commit ba7afee

Browse files
committed
Fixed allow LF and CR as ASCII chars (for NOTES etc)
1 parent 204359f commit ba7afee

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/adif_file/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class IllegalDataTypeException(Exception):
3434
pass
3535

3636

37-
REGEX_ASCII = re.compile(r'[ -~]*')
37+
REGEX_ASCII = re.compile(r'[ -~\n\r]*')
3838
REGEX_PARAM = re.compile(r'[a-zA-Z][a-zA-Z_0-9]*')
3939

4040

test/test_dumpadi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ def test_25_dump_records(self):
7777
'RECORDS': [{'TEST1': 'test',
7878
'TEST2': 'test2'},
7979
{'TEST1': 'test3',
80-
'TEST2': 'test4'}]}
80+
'TEST2': 'test4\r\ntest5'}]}
8181

8282
adi_exp = '''<TEST1:4>test <TEST2:5>test2
8383
<EOR>
8484
85-
<TEST1:5>test3 <TEST2:5>test4
85+
<TEST1:5>test3 <TEST2:12>test4\r\ntest5
8686
<EOR>'''
8787

8888
self.assertEqual(adi_exp, adif_file.dumps_adi(adi_dict))

0 commit comments

Comments
 (0)