[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-07-28 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset f17e001746e0f697e9bd49ac3748f2543b0a0d47 by Miss Islington (bot) 
in branch '3.6':
bpo-33476: Fix _header_value_parser when address group is missing final ';' 
(GH-7484)
https://github.com/python/cpython/commit/f17e001746e0f697e9bd49ac3748f2543b0a0d47


--

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-07-28 Thread miss-islington


miss-islington  added the comment:


New changeset 2be0124b820729eacc1288950b824e336bd3a4a6 by Miss Islington (bot) 
in branch '3.7':
bpo-33476: Fix _header_value_parser when address group is missing final ';' 
(GH-7484)
https://github.com/python/cpython/commit/2be0124b820729eacc1288950b824e336bd3a4a6


--
nosy: +miss-islington

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-07-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8042

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-07-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8040

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-07-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset 8fe9eed937cb69b5e26ac6e36a90b5360eb11277 by Steve Dower (Dong-hee 
Na) in branch 'master':
bpo-33476: Fix _header_value_parser when address group is missing final ';' 
(GH-7484)
https://github.com/python/cpython/commit/8fe9eed937cb69b5e26ac6e36a90b5360eb11277


--
nosy: +steve.dower

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-06-12 Thread Dong-hee Na


Dong-hee Na  added the comment:

@r.david.murray
Can I get a review for PR 7484?

--

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-06-07 Thread Dong-hee Na


Dong-hee Na  added the comment:

@r.david.murray

Please take a look PR 7484 :)

--

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-06-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
pull_requests: +7109
stage: test needed -> patch review

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-29 Thread Dong-hee Na


Dong-hee Na  added the comment:

@Cacadril

Please send a pull request(PR) through CPython 
GitHub(https://github.com/python/cpython)

It will be a great experience :)

--
nosy: +corona10

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-20 Thread Enrique Perez-Terron

Enrique Perez-Terron  added the comment:

Unsure how to issue a "PR" (Problem Report?) with a test case.

Here is my best effort:

Create a file "email.eml" in the current directory, as attached.
(The contents were lifted from RFC2822 section A.1.3, but I deleted the ";" at 
the end of the "To" header. The file has CRLF line endings.)

Then run the following test program (It appears that I can only attach one file 
to this ).

$ cat test-bug.py
from email.policy import default
import email

with open('email.eml', 'rb') as f:
msg = email.message_from_binary_file(f, policy=default)
toheader = msg['To']
for addr in toheader.addresses:
print(addr)

#
# Output without the fix:

$ python3.6.5 test-bug.py
Traceback (most recent call last):
  File "test-bug.py", line 6, in 
toheader = msg['To']
  File "C:\Program Files\Python36\lib\email\message.py", line 391, in 
__getitem__
return self.get(name)
  File "C:\Program Files\Python36\lib\email\message.py", line 471, in get
return self.policy.header_fetch_parse(k, v)
  File "C:\Program Files\Python36\lib\email\policy.py", line 162, in 
header_fetch_parse
return self.header_factory(name, value)
  File "C:\Program Files\Python36\lib\email\headerregistry.py", line 589, in 
__call__
return self[name](name, value)
  File "C:\Program Files\Python36\lib\email\headerregistry.py", line 197, in 
__new__
cls.parse(value, kwds)
  File "C:\Program Files\Python36\lib\email\headerregistry.py", line 340, in 
parse
kwds['parse_tree'] = address_list = cls.value_parser(value)
  File "C:\Program Files\Python36\lib\email\headerregistry.py", line 331, in 
value_parser
address_list, value = parser.get_address_list(value)
  File "C:\Program Files\Python36\lib\email\_header_value_parser.py", line 
1931, in get_address_list
token, value = get_address(value)
  File "C:\Program Files\Python36\lib\email\_header_value_parser.py", line 
1908, in get_address
token, value = get_group(value)
  File "C:\Program Files\Python36\lib\email\_header_value_parser.py", line 
1879, in get_group
if value[0] != ';':
IndexError: string index out of range

#-
# Output with the fix:

$ test-bug.py
Chris Jones 
j...@where.test
John 

--
Added file: https://bugs.python.org/file47606/email.eml

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-14 Thread R. David Murray

R. David Murray  added the comment:

The fix is mostly likely correct, so we need a PR for this that includes tests.

--
keywords: +easy
stage:  -> test needed
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-14 Thread R. David Murray

Change by R. David Murray :


--
type: crash -> behavior

___
Python tracker 

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



[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-12 Thread Enrique Perez-Terron

New submission from Enrique Perez-Terron :

When address group is missing final ';', 'value' will be an empty string. I 
suggest the following patch

$ diff -u _save_header_value_parser.py _header_value_parser.py
--- _save_header_value_parser.py2018-03-14 01:07:54.0 +0100
+++ _header_value_parser.py 2018-05-13 02:17:13.830053600 +0200
@@ -1876,7 +1876,7 @@
 if not value:
 group.defects.append(errors.InvalidHeaderDefect(
 "end of header in group"))
-if value[0] != ';':
+elif value[0] != ';':
 raise errors.HeaderParseError(
 "expected ';' at end of group but found {}".format(value))
 group.append(ValueTerminal(';', 'group-terminator'))

--
components: email
messages: 316440
nosy: Cacadril, barry, r.david.murray
priority: normal
severity: normal
status: open
title: String index out of range in get_group(), email/_header_value_parser.py
type: crash
versions: Python 3.6

___
Python tracker 

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