Message 276475 - Python tracker (original) (raw)

we should likely introduce full wrappers that have a name starting with PyTime, right?

Yes, and I would like to give some thought to what the best API would be. The two choices are to emulate localtime_r on Windows or emulate localtime_s on POSIX. While localtime_r is probably a better known function, localtime_s has been standardized by C11 and may appear on POSIX platforms in the future.

Also, I think _PyTime_localtime_r/s should include the

#ifdef EINVAL if (errno == 0) errno = EINVAL; #endif

code that is repeated everywhere in the current codebase.