This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Test failures on Linux, Python 2.3b1 tarball
Type: Stage:
Components: Build Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: brett.cannon, loewis, nnorwitz, pje, zenzen
Priority: normal Keywords:

Created on 2003-04-26 14:23 by pje, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Messages (14)
msg15616 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2003-04-26 14:23
"make test" resulted in:

test test_tempfile failed -- Traceback (most recent
call last):
  File
"/home/admin/Python-2.3b1/Lib/test/test_tempfile.py",
line 299, in test_noinherit
    self.failIf(retval > 0, "child process reports
failure")
  File "/home/admin/Python-2.3b1/Lib/unittest.py", line
264, in failIf
    if expr: raise self.failureException, msg
AssertionError: child process reports failure

test test_time failed -- Traceback (most recent call last):
  File
"/home/admin/Python-2.3b1/Lib/test/test_time.py", line
107, in test_tzset
    self.failUnless(time.tzname[1] == 'AEDT',
str(time.tzname[1]))
  File "/home/admin/Python-2.3b1/Lib/unittest.py", line
268, in failUnless
    if not expr: raise self.failureException, msg
AssertionError: AEST
msg15617 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-05-04 12:42
Logged In: YES 
user_id=21627

What operating system distribution specifically did you use?
What C library does this system use?
msg15618 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2003-05-04 13:19
Logged In: YES 
user_id=56214

It's an ISP-supplied variant of RedHat 6.2.  I see
'libc-2.1.3.so' in the /lib directory, so I assume that's
the version. Running 'strings' on it, I find:

GNU C Library stable release version 2.1.3, by Roland
McGrath et al.
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99 Free Software
Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or
FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release).
Compiled on a Linux 2.2.19-6.2.16 system on 2002-08-07.
Available extensions:
        GNU libio by Per Bothner
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        BIND-4.9.7-REL
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Glibc-2.0 compatibility add-on by Cristian Gafton 
        linuxthreads-0.8 by Xavier Leroy
        libthread_db work sponsored by Alpha Processor Inc


Python identifies itself as:

Python 2.3b1 (#1, Apr 26 2003, 10:02:40) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2

I just tested 2.3a1 andr 2.3a2 to confirm where the errors
began.  2.3a1 doesn't show either error.  2.3a2 has the
tempfile problem, but not the time problem.
msg15619 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-05-04 15:00
Logged In: YES 
user_id=21627

Neal, it appears you have checked in the test for the AEST
zone. Can you analyse the test_time failure in more detail?
msg15620 - (view) Author: Stuart Bishop (zenzen) Date: 2003-05-22 00:41
Logged In: YES 
user_id=46639

This is from my patch.

Phillip - can you please upload a copy of 'man tzset' on that Redhat box
or email it to zen@shangri-la.dropbear.id.au.

I'd also like to see the output of:
    python -c 'import time;print time.tzname,time.timezone,time.altzone'
    env TZ='US/Eastern' \
        python -c 'import time;print time.tzname,time.timezone,time.altzone'
    env TZ='Australia/Melbourne' \
        python -c 'import time;print time.tzname,time.timezone,time.altzone'

I'm thinking that tzset(3) and the time libraries are not fully functional on 
this earlier version of Redhat, possibly by not handling southern hemisphere 
daylight savings. If so, it needs to be detected during configuration.
msg15621 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2003-05-25 13:21
Logged In: YES 
user_id=56214

Here's the tz info; I'll email you the 'man tzset' separately.

[admin@pilot Python-2.3a1]$ ./python -c 'import time;print
time.tzname,time.timezone,time.altzone'
('EST', 'EDT') 18000 14400
[admin@pilot Python-2.3a1]$ env TZ='US/Eastern' ./python -c
'import time;print time.tzname,time.timezone,time.altzone'
('EST', 'EDT') 18000 14400
[admin@pilot Python-2.3a1]$ env TZ='Australia/Melbourne'
./python -c 'import time;print
time.tzname,time.timezone,time.altzone'
('EST', 'EST') -36000 -39600
[admin@pilot Python-2.3a1]$ cd ../Python-2.3b1
[admin@pilot Python-2.3b1]$ ./python -c 'import time;print
time.tzname,time.timezone,time.altzone'
('EST', 'EDT') 18000 14400
[admin@pilot Python-2.3b1]$ env TZ='US/Eastern' ./python -c
'import time;print time.tzname,time.timezone,time.altzone'
('EST', 'EDT') 18000 14400
[admin@pilot Python-2.3b1]$ env TZ='Australia/Melbourne'
./python -c 'import time;print
time.tzname,time.timezone,time.altzone'
('EST', 'EST') -36000 -39600
[
msg15622 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-10 22:04
Logged In: YES 
user_id=357491

How about the test_tempfile failure?  Does that occur when you 
run the test on its own?
msg15623 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2003-06-10 22:56
Logged In: YES 
user_id=56214

I don't know.  Tell me how to run the test on its own, and
I'll tell you.  :)
msg15624 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-11 00:42
Logged In: YES 
user_id=357491

Sure thing.  =)  Execute this line from a terminal:

python2.3 -c "from test import test_tempfile; 
test_tempfile.test_main()"

All it is doing is importing the test_tempfile module from the test 
package and then executing test_tempfile.test_main() which 
runs all the tests.
msg15625 - (view) Author: Stuart Bishop (zenzen) Date: 2003-06-16 00:53
Logged In: YES 
user_id=46639

Hmm... no file upload button for me in this topic.
Here is a configure.in patch which should stop time.tzset
being build on Redhat 6, and other platforms with this 'problem'
(being that although tzset() may do something useful, it
doesn't do what is documented or called multiple times by the
same process)


Index: dist/src/configure.in
=======================================
============================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.418
diff -c -c -r1.418 configure.in
*** dist/src/configure.in       14 Jun 2003 21:03:05 -0000      
1.418
--- dist/src/configure.in       16 Jun 2003 00:43:24 -0000
***************
*** 2706,2723 ****
  #include <time.h>
  int main()
  {
        int gmt_hour;
        int eastern_hour;
!       time_t now;
!       now = time((time_t*)NULL);
        putenv("TZ=UTC+0");
        tzset();
!       gmt_hour = localtime(&now)->tm_hour;
        putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
        tzset();
!       eastern_hour = localtime(&now)->tm_hour;
!       if (eastern_hour == gmt_hour)
            exit(1);
        exit(0);
  }
  ],
--- 2706,2737 ----
  #include <time.h>
  int main()
  {
+       /* Note that we need to ensure that not only does tzset(3)
+          do 'something' with localtime, but it works as 
documented
+          in the library reference and as expected by the test 
suite. */
        int gmt_hour;
        int eastern_hour;
!       int aus_hour;
!       time_t xmas = 1040774400;
! 
        putenv("TZ=UTC+0");
        tzset();
!       gmt_hour = localtime(&xmas)->tm_hour;
!       if (gmt_hour != 0)
!           exit(1);
! 
        putenv("TZ=EST+5EDT,M4.1.0,M10.5.0");
        tzset();
!       eastern_hour = localtime(&xmas)->tm_hour;
!       if (eastern_hour != 19)
!           exit(1);
! 
!       putenv("TZ=AEST-10AEDT-11,M10.5.0,M3.5.0");
!       tzset();
!       aus_hour = localtime(&xmas)->tm_hour;
!       if (aus_hour != 11)
            exit(1);
+ 
        exit(0);
  }
  ],
msg15626 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2003-06-16 01:58
Logged In: YES 
user_id=56214

Here are the gory details of the tempfile test:

[admin@pilot Python-2.3b1]$ ./python -c "from test import
test_tempfile; test_tempfile.test_main()"
test_exports (test.test_tempfile.test_exports) ... ok
test_get_six_char_str
(test.test_tempfile.test__RandomNameSequence) ... ok
test_many (test.test_tempfile.test__RandomNameSequence) ... ok
test_supports_iter
(test.test_tempfile.test__RandomNameSequence) ... ok
test_nonempty_list
(test.test_tempfile.test__candidate_tempdir_list) ... ok
test_wanted_dirs
(test.test_tempfile.test__candidate_tempdir_list) ... ok
test_retval (test.test_tempfile.test__get_candidate_names)
... ok
test_same_thing
(test.test_tempfile.test__get_candidate_names) ... ok
test_basic (test.test_tempfile.test__mkstemp_inner) ... ok
test_basic_many (test.test_tempfile.test__mkstemp_inner) ... ok
test_choose_directory
(test.test_tempfile.test__mkstemp_inner) ... ok
test_file_mode (test.test_tempfile.test__mkstemp_inner) ... ok
fd 3 is open in childtest_noinherit
(test.test_tempfile.test__mkstemp_inner) ... FAIL
test_textmode (test.test_tempfile.test__mkstemp_inner) ... ok
test_sane_template (test.test_tempfile.test_gettempprefix)
... ok
test_usable_template (test.test_tempfile.test_gettempprefix)
... ok
test_directory_exists (test.test_tempfile.test_gettempdir)
... ok
test_directory_writable (test.test_tempfile.test_gettempdir)
... ok
test_same_thing (test.test_tempfile.test_gettempdir) ... ok
test_basic (test.test_tempfile.test_mkstemp) ... ok
test_choose_directory (test.test_tempfile.test_mkstemp) ... ok
test_basic (test.test_tempfile.test_mkdtemp) ... ok
test_basic_many (test.test_tempfile.test_mkdtemp) ... ok
test_choose_directory (test.test_tempfile.test_mkdtemp) ... ok
test_mode (test.test_tempfile.test_mkdtemp) ... ok
test_basic (test.test_tempfile.test_mktemp) ... ok
test_many (test.test_tempfile.test_mktemp) ... ok
test_basic (test.test_tempfile.test_NamedTemporaryFile) ... ok
test_creates_named
(test.test_tempfile.test_NamedTemporaryFile) ... ok
test_del_on_close
(test.test_tempfile.test_NamedTemporaryFile) ... ok
test_multiple_close
(test.test_tempfile.test_NamedTemporaryFile) ... ok
test_basic (test.test_tempfile.test_TemporaryFile) ... ok
test_has_no_name (test.test_tempfile.test_TemporaryFile) ... ok
test_multiple_close (test.test_tempfile.test_TemporaryFile)
... ok

======================================================================
FAIL: test_noinherit (test.test_tempfile.test__mkstemp_inner)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/admin/Python-2.3b1/Lib/test/test_tempfile.py",
line 299, in test_noinherit
    self.failIf(retval > 0, "child process reports failure")
  File "/home/admin/Python-2.3b1/Lib/unittest.py", line 264,
in failIf
    if expr: raise self.failureException, msg
AssertionError: child process reports failure

----------------------------------------------------------------------
Ran 34 tests in 0.217s

FAILED (failures=1)
Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/home/admin/Python-2.3b1/Lib/test/test_tempfile.py",
line 651, in test_main
    test_support.run_suite(suite)
  File "/home/admin/Python-2.3b1/Lib/test/test_support.py",
line 229, in run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "/home/admin/Python-2.3b1/Lib/test/test_tempfile.py",
line 299, in test_noinherit
    self.failIf(retval > 0, "child process reports failure")
  File "/home/admin/Python-2.3b1/Lib/unittest.py", line 264,
in failIf
    if expr: raise self.failureException, msg
AssertionError: child process reports failure
msg15627 - (view) Author: Stuart Bishop (zenzen) Date: 2003-06-30 00:47
Logged In: YES 
user_id=46639

I've re-uploaded the tzset configure.in patch as:
    http://www.python.org/sf/728051

The version in this bug report looks mangled.
msg15628 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-10-28 21:12
Logged In: YES 
user_id=33168

What's the status of this bug?  Is it still an issue or can
it be closed?
msg15629 - (view) Author: PJ Eby (pje) * (Python committer) Date: 2003-10-28 22:23
Logged In: YES 
user_id=56214

All tests pass as of Python 2.3.2, so this bug can be closed.
History
Date User Action Args
2022-04-10 16:08:21adminsetgithub: 38373
2003-04-26 14:23:41pjecreate