Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(254304)

#16986: ElementTree incorrectly parses strings with declared encoding not UTF-8 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 5 months ago by storchaka+cpython
Modified:
6 years ago
Reviewers:
eliben
CC:
eli.bendersky, devnull_psf.upfronthosting.co.za, storchaka
Visibility:
Public.

Patch Set 1 #

Total comments: 8

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Include/pyexpat.h View 1 1 chunk +1 line, -0 lines 0 comments Download
Lib/test/test_xml_etree.py View 1 4 chunks +30 lines, -15 lines 0 comments Download
Modules/_elementtree.c View 1 3 chunks +30 lines, -9 lines 0 comments Download
Modules/pyexpat.c View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 4
eli.bendersky
http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c File Modules/_elementtree.c (right): http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c#newcode3337 Modules/_elementtree.c:3337: while (data_len > MAX_CHUNK_SIZE) { How is this change ...
6 years, 5 months ago #1
storchaka_gmail.com
http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c File Modules/_elementtree.c (right): http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c#newcode3337 Modules/_elementtree.c:3337: while (data_len > MAX_CHUNK_SIZE) { On 2013/02/26 15:00:02, eli.bendersky ...
6 years, 5 months ago #2
eli.bendersky
http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c File Modules/_elementtree.c (right): http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c#newcode3337 Modules/_elementtree.c:3337: while (data_len > MAX_CHUNK_SIZE) { On 2013/03/04 15:29:47, storchaka ...
6 years, 3 months ago #3
storchaka_gmail.com
6 years, 3 months ago #4
http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c
File Modules/_elementtree.c (right):

http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c#newcode3337
Modules/_elementtree.c:3337: while (data_len > MAX_CHUNK_SIZE) {
On 2013/05/22 14:26:36, eli.bendersky wrote:
> I just prefer it to be done separately, keeping one patch/issue minimal
> per-problem.

Well, I'll limit the size of parsed data to INT_MAX.

> Yes, but in this particular case it's very easy to rewrite without :-) You can
> use a do...while loop for example and look at min(data_len, MAX_CHUNK_SIZE).

Current patch looks a much better to me, but in any case this code will be
dropped.

http://bugs.python.org/review/16986/diff/7474/Modules/_elementtree.c#newcode3400
Modules/_elementtree.c:3400: Py_buffer view;
On 2013/05/22 14:26:36, eli.bendersky wrote:
> I'm wondering why this is better than PyBytes_AsStringAndSize ?

It works with any bytes-like object.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+