This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients Ramin Farajpour Cami, eryksun, methane, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-02-20.06:28:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613802531.89.0.1153863108.issue43260@roundup.psfhosted.org>
In-reply-to
Content
You are right. I misunderstood.

```
        if (PyUnicode_IS_ASCII(text) &&
              (PyUnicode_GET_LENGTH(text) +
                (self->pending_bytes ? self->pending_bytes_count : 0)) <=
                  self->chunk_size &&
              is_asciicompat_encoding(self->encodefunc)) {
            b = text;
            Py_INCREF(b);
        }
```

This seems too complex and defensive.  Isn't `PyUnicode_GET_LENGTH(text) < self->chunk_size` enough?

When `PyUnicode_GET_LENGTH(text) + self->pending_bytes_count > self->chunk_size`, `self->pending_bytes` is preflushed anyway.
History
Date User Action Args
2021-02-20 06:28:51methanesetrecipients: + methane, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, Ramin Farajpour Cami
2021-02-20 06:28:51methanesetmessageid: <1613802531.89.0.1153863108.issue43260@roundup.psfhosted.org>
2021-02-20 06:28:51methanelinkissue43260 messages
2021-02-20 06:28:51methanecreate