Message 66519 - Python tracker
This affects OS X too. I'm attaching two patches - one uses malloc to build a bigger string if the existing implementation returns ERANGE, and the other one uses malloc from the start. This was done on the theory that stack memory use would be better/more efficient. However, based on testing, there's no real difference - 16.8usec vs. 17usec - on a rarely-used function.