Skip to content

Commit d6d6642

Browse files
committed
init.loadTemplateInfo: replace rfc822 with email.parser (Python 3 compatible)
1 parent 39544cd commit d6d6642

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

roundup/init.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"""
2020
__docformat__ = 'restructuredtext'
2121

22-
import os, errno, rfc822
22+
import os, errno, email.parser
23+
2324

2425
from roundup import install_util, password
2526
from roundup.configuration import CoreConfig
@@ -138,7 +139,7 @@ def loadTemplateInfo(path):
138139

139140
# load up the template's information
140141
with open(tif) as f:
141-
m = rfc822.Message(f)
142+
m = email.parser.Parser().parse(f, True)
142143
ti = {}
143144
ti['name'] = m['name']
144145
ti['description'] = m['description']

test/test_init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def testLoadTemplateInfo(self):
1515
{
1616
'description': textwrap.dedent('''\
1717
This is a generic issue tracker that may be used to track bugs,
18-
feature requests, project issues or any number of other types
19-
of issues. Most users of Roundup will find that this template
20-
suits them, with perhaps a few customisations.'''),
18+
feature requests, project issues or any number of other types
19+
of issues. Most users of Roundup will find that this template
20+
suits them, with perhaps a few customisations.'''),
2121
'intended-for': 'All first-time Roundup users',
2222
'name': 'classic',
2323
'path': path

0 commit comments

Comments
 (0)