| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…er_value_parser.py and created tests in test__header_value_parser.py for CFWS.
|
To mention this borrows a test case from GH-6907 (which seeems to be abandoned, which is why I am proposing this new PR to override that). The fix however is different than GH-6907, which is why I haven't added a Co-Authored-By: in the PR message since I don't know if the original author agrees with my implementation. |
Sorry, something went wrong.
Also, modify the testcase.
There was a problem hiding this comment.
LGTM. Thank you for providing the test. It is always useful. :)
Sorry, something went wrong.
| leader, value = get_cfws(value) | ||
| else: | ||
| leader = None | ||
| if not value: |
There was a problem hiding this comment.
Do you want to catch all false-y values or just None?
Sorry, something went wrong.
There was a problem hiding this comment.
I want to catch None and empty string '' values, both of which could cause IndexError when running value[0]. It could also be caused by empty list, empty tuple etc etc, but I don't think value can be of those datatypes.
Sorry, something went wrong.
Remove implicit concatenation of strings and move the string to next line so that it can fit properly under 79 chars.
|
I'm assuming this needs backporting to 3.7 and 3.8. |
Sorry, something went wrong.
…edly (pythonGH-14387) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word. (cherry picked from commit 7213df7) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
|
GH-14411 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
|
GH-14412 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
…edly (pythonGH-14387) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word. (cherry picked from commit 7213df7) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
…edly (GH-14387) (GH-14412) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word. (cherry picked from commit 7213df7) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
…edly (GH-14387) (GH-14411) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word. (cherry picked from commit 7213df7) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
…edly (pythonGH-14387) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word.
…edly (pythonGH-14387) * patched string index out of range error in get_word function of _header_value_parser.py and created tests in test__header_value_parser.py for CFWS. * Raise HeaderParseError instead of continuing when parsing a word.
| Back | FazBrowse Home | New Git URL |
When parsing a word, if the value is None, we should raise HeaderParseError instead of continuing silently. This helps fix the IndexError.
Part of the patch is from GH-6907, so thanks to @TyrannosourceExe.
https://bugs.python.org/issue29412