Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-134152: fixUnboundLocalError while parsingmessage_id in email#134194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sergey-miryanov wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromsergey-miryanov:gh-134152-fix-unbound-local-error-in-email
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionLib/email/_header_value_parser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1573,7 +1573,7 @@ def get_dtext(value):
def _check_for_early_dl_end(value, domain_literal):
if value:
return False
domain_literal.append(errors.InvalidHeaderDefect(
domain_literal.defects.append(errors.InvalidHeaderDefect(
"end of input inside domain-literal"))
domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
return True
Expand Down
6 changes: 6 additions & 0 deletionsLib/test/test_email/test__header_value_parser.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2732,6 +2732,12 @@ def test_parse_valid_message_id(self):
)
self.assertEqual(message_id.token_type, 'message-id')

def test_parse_message_id_with_invalid_domain(self):
message_id = parser.parse_message_id("<T@[")
self.assertEqual(message_id.token_type, 'message-id')
self.assertEqual(str(message_id.all_defects[-1]),
"end of input inside domain-literal")

def test_parse_message_id_with_remaining(self):
message_id = self._test_parse_x(
parser.parse_message_id,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
:mod:`email`: Fix parsing of emails message ID with invalid domain.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp