[Patches] [ python-Patches-459385 ] 2.1.1 time.timezone fix for Cygwin

noreply@sourceforge.net noreply@sourceforge.net
Thu, 13 Sep 2001 17:14:55 -0700


Patches item #459385, was opened at 2001-09-06 18:27
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=459385&group_id=5470

Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Norman Vine (nhv)
Assigned to: Nobody/Anonymous (nobody)
Summary: 2.1.1 time.timezone fix for Cygwin

Initial Comment:
*** timemodule.bak	Wed Jun 27 09:01:54 2001
--- timemodule.c	Thu Sep  6 20:29:28 2001
***************
*** 599,605 ****
  	/* Squirrel away the module's dictionary for 
the y2k check */
  	Py_INCREF(d);
  	moddict = d;
! #if defined(HAVE_TZNAME) && !defined(__GLIBC__)
  	tzset();
  #ifdef PYOS_OS2
  	ins(d, "timezone", PyInt_FromLong((long)
_timezone));
--- 599,605 ----
  	/* Squirrel away the module's dictionary for 
the y2k check */
  	Py_INCREF(d);
  	moddict = d;
! #if defined(HAVE_TZNAME) && !defined(__GLIBC__) &&!
defined(__CYGWIN__)
  	tzset();
  #ifdef PYOS_OS2
  	ins(d, "timezone", PyInt_FromLong((long)
_timezone));


----------------------------------------------------------------------

Comment By: Jason Tishler (jlt63)
Date: 2001-09-13 17:14

Message:
Logged In: YES 
user_id=86216

Argh! I guess that I can mail the patch to Norman and then ask him to upload it...

----------------------------------------------------------------------

Comment By: Jason Tishler (jlt63)
Date: 2001-09-13 17:11

Message:
Logged In: YES 
user_id=86216

[I guess that there is not a way to upload a patch if you are not the submitter?]

I concur that this patch should be accepted.  However, I offer the following
slightly more aesthetic, but otherwise functionality identical patch:

Index: timemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v
retrieving revision 2.113
diff -c -r2.113 timemodule.c
*** timemodule.c	2001/08/22 12:39:16	2.113
--- timemodule.c	2001/09/13 17:54:27
***************
*** 599,605 ****
  	/* Squirrel away the module's dictionary for the y2k check */
  	Py_INCREF(d);
  	moddict = d;
! #if defined(HAVE_TZNAME) && !defined(__GLIBC__)
  	tzset();
  #ifdef PYOS_OS2
  	ins(d, "timezone", PyInt_FromLong((long)_timezone));
--- 599,605 ----
  	/* Squirrel away the module's dictionary for the y2k check */
  	Py_INCREF(d);
  	moddict = d;
! #if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__)
  	tzset();
  #ifdef PYOS_OS2
  	ins(d, "timezone", PyInt_FromLong((long)_timezone));
***************
*** 617,623 ****
  #endif
  	ins(d, "daylight", PyInt_FromLong((long)daylight));
  	ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1]));
! #else /* !HAVE_TZNAME || __GLIBC__ */
  #ifdef HAVE_TM_ZONE
  	{
  #define YEAR ((time_t)((365 * 24 + 6) * 3600))
--- 617,623 ----
  #endif
  	ins(d, "daylight", PyInt_FromLong((long)daylight));
  	ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1]));
! #else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/
  #ifdef HAVE_TM_ZONE
  	{
  #define YEAR ((time_t)((365 * 24 + 6) * 3600))
***************
*** 673,679 ****
  	ins(d, "daylight", PyInt_FromLong(_daylight));
  	ins(d, "tzname", Py_BuildValue("(zz)", _tzname[0], _tzname[1]));
  #endif /* __CYGWIN__ */
! #endif /* !HAVE_TZNAME || __GLIBC__ */
  }
  
  
--- 673,679 ----
  	ins(d, "daylight", PyInt_FromLong(_daylight));
  	ins(d, "tzname", Py_BuildValue("(zz)", _tzname[0], _tzname[1]));
  #endif /* __CYGWIN__ */
! #endif /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/
  }
  
  


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=459385&group_id=5470