From: Samuel Tyler Date: Mon, 3 Mar 2025 13:59:46 +0000 (+1100) Subject: gh-100388: Change undefined __DATE__ to the Unix epoch (#100389) X-Git-Tag: v3.14.0a6~185 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f14b7e30c0243e81407a34968495301e829a033;p=thirdparty%2FPython%2Fcpython.git gh-100388: Change undefined __DATE__ to the Unix epoch (#100389) --- diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst b/Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst new file mode 100644 index 000000000000..d859c5511e6d --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2022-12-21-14-28-01.gh-issue-100388.vne8ky.rst @@ -0,0 +1,2 @@ +Fix the ``platform._sys_version()`` method when ``__DATE__`` is undefined at +buildtime by changing default buildtime datetime string to the UNIX epoch. diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 8d553d106c6a..b68f0f5cc56a 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -13,7 +13,7 @@ #ifdef __DATE__ #define DATE __DATE__ #else -#define DATE "xx/xx/xx" +#define DATE "Jan 01 1970" #endif #endif @@ -21,7 +21,7 @@ #ifdef __TIME__ #define TIME __TIME__ #else -#define TIME "xx:xx:xx" +#define TIME "00:00:00" #endif #endif