[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-08-11 Thread Abhilash Raj


Change by Abhilash Raj :


--
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-08-11 Thread miss-islington


miss-islington  added the comment:


New changeset dec231a73c2a463b29f19c4e8357602c10a68856 by Miss Islington (bot) 
in branch '3.7':
bpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. 
(GH-15044)
https://github.com/python/cpython/commit/dec231a73c2a463b29f19c4e8357602c10a68856


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-08-11 Thread miss-islington


miss-islington  added the comment:


New changeset 9500bbe9372f6080decc49d2fd9365f0b927a0e2 by Miss Islington (bot) 
in branch '3.8':
bpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. 
(GH-15044)
https://github.com/python/cpython/commit/9500bbe9372f6080decc49d2fd9365f0b927a0e2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-08-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14941
pull_request: https://github.com/python/cpython/pull/15213

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-08-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14942
pull_request: https://github.com/python/cpython/pull/15214

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-08-11 Thread miss-islington


miss-islington  added the comment:


New changeset 09a1872a8007048dcdf825a476816c5e3498b8f8 by Miss Islington (bot) 
(Abhilash Raj) in branch 'master':
bpo-32178: Fix IndexError trying to parse 'To' header starting with ':'. 
(GH-15044)
https://github.com/python/cpython/commit/09a1872a8007048dcdf825a476816c5e3498b8f8


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-07-30 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +14799
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/15044

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-07-09 Thread R. David Murray


R. David Murray  added the comment:

The fact that the original report mentions HeaderParserError implies that the 
new API is being used, though the report didn't make that clear.  The problem 
still exists:

>>> m = message_from_string("To: :Foo  
>>> \n\n", policy=default)
>>> m['To']
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/rdmurray/python/p38/Lib/email/message.py", line 391, in 
__getitem__
return self.get(name)
  File "/home/rdmurray/python/p38/Lib/email/message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
  File "/home/rdmurray/python/p38/Lib/email/policy.py", line 163, in 
header_fetch_parse
return self.header_factory(name, value)
  File "/home/rdmurray/python/p38/Lib/email/headerregistry.py", line 602, in 
__call__
return self[name](name, value)
  File "/home/rdmurray/python/p38/Lib/email/headerregistry.py", line 197, in 
__new__
cls.parse(value, kwds)
  File "/home/rdmurray/python/p38/Lib/email/headerregistry.py", line 343, in 
parse
groups.append(Group(addr.display_name,
  File "/home/rdmurray/python/p38/Lib/email/_header_value_parser.py", line 315, 
in display_name
return self[0].display_name
  File "/home/rdmurray/python/p38/Lib/email/_header_value_parser.py", line 382, 
in display_name
return self[0].display_name
  File "/home/rdmurray/python/p38/Lib/email/_header_value_parser.py", line 564, 
in display_name
if res[0].token_type == 'cfws':
IndexError: list index out of range

--
resolution: out of date -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-07-03 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Based on @maxking's comment, I'm going to close this issue.  Thank you!

--
nosy: +cheryl.sabella
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2019-06-14 Thread Abhilash Raj


Abhilash Raj  added the comment:

I don't think this is an issue anymore, I guess this was fixed as a part of 
some other PR.

I tested this out on a recent branch:

   >>> import email
   >>> msg = email.message_from_string('From: Abhilash  
')
   >>> msg['From'] 
   'Abhilash  '

@david, @barry: I think we can close this issue.

--
nosy: +maxking

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2017-11-30 Thread Massimiliano Torromeo

Massimiliano Torromeo  added the comment:

Disregard my last message, I posted it in the wrong bug report by mistake.
Sorry about the noise

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2017-11-30 Thread Massimiliano Torromeo

Change by Massimiliano Torromeo :


--
pull_requests:  -4558

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2017-11-30 Thread Massimiliano Torromeo

Massimiliano Torromeo  added the comment:

In case an address email header contains and empty string, the tokenizer return 
a BareQuotedString
which is also a TokenList, but this list is empty and the parser fails to check 
this and insteads raises an IndexError.

For example an email with this header will trigger the IndexError:
ReplyTo: ""

--
keywords: +patch
pull_requests: +4558
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32178] Some invalid email address groups cause an IndexError instead of a HeaderParseError

2017-11-30 Thread Massimiliano Torromeo

New submission from Massimiliano Torromeo :

With some malformed email address list, the parser for email groups raises an 
`IndexError` instead of the correct `HeaderParseError`.

This results in a complete failure to parse the email while it is still 
preferable to just ignore the malformed header.

An example of such a malformed list is this:
`To: :Foo  `

--
components: email
messages: 307285
nosy: Massimiliano Torromeo, barry, r.david.murray
priority: normal
pull_requests: 4556
severity: normal
status: open
title: Some invalid email address groups cause an IndexError instead of a 
HeaderParseError
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com