[issue29412] IndexError thrown on email.message.Message.get

2019-08-16 Thread Abhilash Raj


Change by Abhilash Raj :


--
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.8, Python 3.9 -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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset b950cdb4beabeb093fa3ccc35f53d51cc0193aba by Barry Warsaw (Miss 
Islington (bot)) in branch '3.7':
bpo-29412: Fix indexError when parsing a header value ending unexpectedly 
(GH-14387) (GH-14412)
https://github.com/python/cpython/commit/b950cdb4beabeb093fa3ccc35f53d51cc0193aba


--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset 82654a037211a3466a294d53952926fc87f8403d by Barry Warsaw (Miss 
Islington (bot)) in branch '3.8':
bpo-29412: Fix indexError when parsing a header value ending unexpectedly 
(GH-14387) (GH-14411)
https://github.com/python/cpython/commit/82654a037211a3466a294d53952926fc87f8403d


--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14224
pull_request: https://github.com/python/cpython/pull/14412

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:


New changeset 7213df7bbfd85378c6e42e1ac63144d5974bdcf6 by Barry Warsaw 
(Abhilash Raj) in branch 'master':
bpo-29412: Fix indexError when parsing a header value ending unexpectedly 
(GH-14387)
https://github.com/python/cpython/commit/7213df7bbfd85378c6e42e1ac63144d5974bdcf6


--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14223
pull_request: https://github.com/python/cpython/pull/14411

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-25 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +14201
pull_request: https://github.com/python/cpython/pull/14387

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-14 Thread Abhilash Raj


Abhilash Raj  added the comment:

Nevermind, I was wrong, I was able to reproduce it:

>>> msg = email.message_from_string('To: (Recipient list suppressed)', 
>>> policy=email.policy.default))
  File "", line 1
SyntaxError: unmatched ')'
>>> msg = email.message_from_string('To: (Recipient list suppressed)', 
>>> policy=email.policy.default)
>>> msg.get('to')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/maxking/Documents/cpython/Lib/email/message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
  File "/home/maxking/Documents/cpython/Lib/email/policy.py", line 163, in 
header_fetch_parse
return self.header_factory(name, value)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 589, 
in __call__
return self[name](name, value)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 197, 
in __new__
cls.parse(value, kwds)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 340, 
in parse
kwds['parse_tree'] = address_list = cls.value_parser(value)
  File "/home/maxking/Documents/cpython/Lib/email/headerregistry.py", line 331, 
in value_parser
address_list, value = parser.get_address_list(value)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 1951, in get_address_list
token, value = get_address(value)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 1928, in get_address
token, value = get_group(value)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 1884, in get_group
token, value = get_display_name(value)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 1710, in get_display_name
token, value = get_phrase(value)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 1385, in get_phrase
token, value = get_word(value)
  File "/home/maxking/Documents/cpython/Lib/email/_header_value_parser.py", 
line 1360, in get_word
if value[0]=='"':
IndexError: string index out of range

--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-14 Thread Abhilash Raj


Abhilash Raj  added the comment:

For the record, this is how I tested using the master branch:

>>> msg = email.message_from_string('  To: (Recipient list suppressed)')
>>> msg['To']
>>> import email.policy
>>> msg = email.message_from_string('  To: (Recipient list suppressed)', 
>>> policy=email.policy.default)
>>> msg

>>> msg['To']
>>> msg.get('to')

--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2019-06-14 Thread Abhilash Raj


Abhilash Raj  added the comment:

I can't reproduce this problem with the latest master branch, it was perhaps 
fixed with some other PR. 

This is also a dupe of bpo-31445.

@barry, @david: I think this issue can be closed.

--
nosy: +maxking

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2018-05-16 Thread Terry Thurk

Change by Terry Thurk :


--
pull_requests:  -6509

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2018-05-16 Thread Terry Thurk

Change by Terry Thurk :


--
pull_requests: +6575

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2018-05-14 Thread Terry Thurk

Change by Terry Thurk :


--
pull_requests: +6509
stage:  -> patch review

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-07 Thread Joel Uckelman

Joel Uckelman added the comment:

Here's a patch, complete with tests.

If the value is all CFWS, then get_cfws(value)[1], which is what's left after 
the CFWS is extracted, is the empty string---which is why value[0] throws in 
this case.

--
keywords: +patch
Added file: http://bugs.python.org/file46562/29412.patch

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-07 Thread Joel Uckelman

Joel Uckelman added the comment:

I'm working on a patch now.

--

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-03 Thread R. David Murray

R. David Murray added the comment:

I'm really short on time to even review patches these days, but I'll see if I 
can pry any loose if someone wants to propose a patch.

--
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-02 Thread Xiang Zhang

Xiang Zhang added the comment:

This seems not related to #27931.

The problem is that the receiver's content is only CFWS. It's just like it's 
empty and for the default policy, it checks `value[0] == '"'` in `get_word`.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue29412] IndexError thrown on email.message.Message.get

2017-02-01 Thread Joel Uckelman

Changes by Joel Uckelman :


--
title: IndexError thrown on email.message.EmailMessage.get -> IndexError thrown 
on email.message.Message.get

___
Python tracker 

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