Skip to content

Commit b28003b

Browse files
committed
Add some comments.
1 parent 1b65977 commit b28003b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Lib/gettext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ def _parse(self, fp):
417417
item = b_item.decode().strip()
418418
if not item:
419419
continue
420+
# Skip over comment lines:
420421
if item.startswith('#-#-#-#-#') and item.endswith('#-#-#-#-#'):
421422
continue
422423
k = v = None

Lib/test/test_gettext.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,12 @@ def test_plural_form_error_issue17898(self):
685685
t = gettext.GNUTranslations(fp)
686686

687687
def test_ignore_comments_in_headers_issue36239(self):
688+
"""Checks that comments like:
689+
690+
#-#-#-#-# messages.po (EdX Studio) #-#-#-#-#
691+
692+
are ignored.
693+
"""
688694
with open(MOFILE, 'wb') as fp:
689695
fp.write(base64.decodebytes(GNU_MO_DATA_ISSUE_17898))
690696
with open(MOFILE, 'rb') as fp:

0 commit comments

Comments
 (0)