Closed
Description
There's a fast-path in PyBytes_FromStringAndSize
that is not covered:
Lines 120 to 124 in 8549559
Here:
Lines 111 to 124 in 8549559
We don't have test cases for it:
cpython/Lib/test/test_capi/test_bytes.py
Lines 49 to 65 in 8549559
I propose adding:
self.assertEqual(fromstringandsize(b'a'), b'a')
self.assertEqual(fromstringandsize(b'a', 1), b'a')
So we would have better C coverage stats. It won't hurt in any case, even if this path is removed some day.