Armin Rigo added the comment: It's seriously obscure to call a user-defined __oct__ method and then mangle the resulting string in ways that only make sense if the __oct__ method returned something reasonable.
The patch is probably a little more complicated than it could be. For example, I don't understand the special cases for `llen <= 1`: I don't think `PyString_FromStringAndSize(NULL, 1)` can return an existing object. And if you cut off the final 'L' you don't replace it with '\0' any longer, which could in theory break some callers expecting to see a null-terminated string here. PyErr_Format() should use `%.200s` for `tp_name`. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11145> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com