MCPcopy Index your code
hub / github.com/python/cpython / get_invalid_mailbox

Function get_invalid_mailbox

Lib/email/_header_value_parser.py:1854–1870  ·  view source on GitHub ↗

Read everything up to one of the chars in endchars. This is outside the formal grammar. The InvalidMailbox TokenList that is returned acts like a Mailbox, but the data attributes are None.

(value, endchars)

Source from the content-addressed store, hash-verified

1852 return mailbox, value
1853
1854def get_invalid_mailbox(value, endchars):
1855 """ Read everything up to one of the chars in endchars.
1856
1857 This is outside the formal grammar. The InvalidMailbox TokenList that is
1858 returned acts like a Mailbox, but the data attributes are None.
1859
1860 """
1861 invalid_mailbox = InvalidMailbox()
1862 while value and value[0] not in endchars:
1863 if value[0] in PHRASE_ENDS:
1864 invalid_mailbox.append(ValueTerminal(value[0],
1865 'misplaced-special'))
1866 value = value[1:]
1867 else:
1868 token, value = get_phrase(value)
1869 invalid_mailbox.append(token)
1870 return invalid_mailbox, value
1871
1872def get_mailbox_list(value):
1873 """ mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list

Callers 2

get_mailbox_listFunction · 0.85
get_address_listFunction · 0.85

Calls 4

InvalidMailboxClass · 0.85
ValueTerminalClass · 0.85
get_phraseFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…