See bug http://python.org/sf/1556784 By putting the length into a char, wrap_strftime() restricts the format string to be 127 characters long. This patch removes that restriction, but using Py_ssize_t. Test included. Patch is against release25-maint.