8000 Python doesn't like creating 0-length strings. · matplotlib/matplotlib@d04bc6b · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d04bc6b

Browse files
committed
Python doesn't like creating 0-length strings.
1 parent 1b2a762 commit d04bc6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/_path_wrapper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,10 @@ static PyObject *Py_convert_to_string(PyObject *self, PyObject *args, PyObject *
674674
}
675675

676676
size_t buffersize = path.total_vertices() * (precision + 5) * 4;
677+
if (buffersize == 0) {
678+
return PyBytes_FromString("");
679+
}
680+
677681
PyObject *bufferobj = PyBytes_FromStringAndSize(NULL, buffersize);
678682
if (bufferobj == NULL) {
679683
return NULL;

0 commit comments

Comments
 (0)
0