[Patches] [ python-Patches-706707 ] time.tzset standards compliance update

SourceForge.net noreply@sourceforge.net
Fri, 11 Apr 2003 08:52:38 -0700


Patches item #706707, was opened at 2003-03-19 23:57
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=706707&group_id=5470

Category: Library (Lib)
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 7
Submitted By: Stuart Bishop (zenzen)
Assigned to: Neal Norwitz (nnorwitz)
Summary: time.tzset standards compliance update

Initial Comment:
Update to configure.in and test_time.py to only use TZ
environment variable format documented at
http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap08.html



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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-04-11 11:52

Message:
Logged In: YES 
user_id=33168

Checked in as:
 configure: 1.390
 configure.in: 1.401
 Lib/test/test_time.py: 1.14


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2003-04-11 11:38

Message:
Logged In: YES 
user_id=6380

Neal, I think you can check it in now.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-04-10 22:33

Message:
Logged In: YES 
user_id=33168

Stuart, I saw the mails on py-dev, but am not sure about any
conclusions.  I tested the patch on Solaris 8 and Redhat
7.2.  Solaris works (fails before the patch).  Redhat fails
with the patch, but I think it worked before the patch.  I
can check in to test on other architectures and back out if
necessary.  Let me know how to proceed.  Thanks.

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

Comment By: Stuart Bishop (zenzen)
Date: 2003-04-06 22:19

Message:
Logged In: YES 
user_id=46639

The bare except can go (just 'time.tzset()' without the
try..except around it).

The failure under Redhat is wierd - I can confirm that it
works on a Redhat 7.2 box (as well as under OS X 10.2 and
Solaris 2.8).

The Australian timezone checks are testing that the timezone
initialization stuff works in the southern hemisphere, and
that time.altzone is being reset by tzset().

This will probably need to be taken to Python-dev unless you
feel like applying the patch to HEAD and seeing who screams.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-29 16:46

Message:
Logged In: YES 
user_id=33168

In the last chunk added, there is a bare except when calling
time.tzset().  What are the possible exceptions?  I don't
want to have a bare except since this can mask a real error.

The patch still fails for me on Linux (Redhat):
 * line 107: self.failUnless(time.tzname[1] == 'AEDT')
       - tzname has:  ('AEST', 'AEST')
 * line 109: self.failUnlessEqual(time.daylight, 1)
 * line 111: self.failUnlessEqual(time.altzone, -39600)
Haven't tried on other Unixes.

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

Comment By: Stuart Bishop (zenzen)
Date: 2003-03-27 15:12

Message:
Logged In: YES 
user_id=46639

tzset3.diff is an updated diff against the CVS head.

Fixes:
   -Don't test time.altzone for UTC - non-DST means altzone
is undefined
   -Make sure dst timezone name is not the same as non-dst
timezone
    name in TZ environment variable, to work around an
apparent Solaris
    bug.
   -Extraneous cruft removed from test_time.py and
configure.in - no
    more irrelevant comments.
   -More whitespace as per Tim's comments
    comments.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-21 16:28

Message:
Logged In: YES 
user_id=33168

After patching, the test fails:

  File "/home/neal/build/python/2_3/Lib/test/test_time.py",
line 115, in test_tzset
    self.failUnlessEqual(time.daylight,1)
  File "/home/neal/build/python/2.3/Lib/unittest.py", line
292, in failUnlessEqual
    raise self.failureException, \
AssertionError: 0 != 1


Also, why is the code commented out (via a string) on lines
120-144?  Should these be removed?  I see the comment about
wallclock time, but don't understand why the code should be
left in if we can't test it.  I can understand a comment
describing generally the issue.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2003-03-20 20:18

Message:
Logged In: YES 
user_id=33168

I'll try to get to this soon.

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2003-03-20 20:11

Message:
Logged In: YES 
user_id=6380

Unassigning, as I won't hve time for this. But it is
important - someone else should make sure this goes into 2.3b1!

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

Comment By: Tim Peters (tim_one)
Date: 2003-03-20 16:50

Message:
Logged In: YES 
user_id=31435

Assigned to Guido, as I can't test it.

Two notes:

1. Leaving commented-out code in config and the test suite 
doesn't appear to serve a purpose, although it will serve to 
confuse future readers ("why is this here?  why is it 
commented out?").

2. The Python style guide asks for a blank after commas in 
argument lists and tuples.  We're not really in danger of 
stretching the screen here <wink>.

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

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