classification
Title: test_distutils fails because of borked compress program
Type: behavior Stage: resolved
Components: Distutils, Distutils2 Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7, 3rd party
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, brett.cannon, eric.araujo, tarek, westley.martinez
Priority: normal Keywords:

Created on 2011-02-26 20:29 by westley.martinez, last changed 2011-09-06 16:16 by eric.araujo. This issue is now closed.

Files
File name Uploaded Description Edit
test_distutils westley.martinez, 2011-02-26 20:29 Test output
Messages (20)
msg129588 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-02-26 20:29
test_compressed_deprecated failed
msg129651 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-27 20:38
Can you provide the test's failing report and traceback?
msg129653 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-27 21:05
My mistake; missed the attachment.
msg130122 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-05 15:50
Thanks for the report.  What is your OS name and exact version?
msg130126 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-03-05 17:42
Arch Linux
kernel 2.6.37.2
glibc 2.13
msg132113 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-25 16:32
Can you run “./python -m distutils.tests.test_archive_util”?  We may get more output.
msg132170 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-03-25 22:28
test_check_archive_formats (__main__.ArchiveUtilTestCase) ... ok
test_compress_deprecated (__main__.ArchiveUtilTestCase) ... FAIL
test_make_archive (__main__.ArchiveUtilTestCase) ... ok
test_make_archive_cwd (__main__.ArchiveUtilTestCase) ... ok
test_make_tarball (__main__.ArchiveUtilTestCase) ... ok
test_make_zipfile (__main__.ArchiveUtilTestCase) ... ok
test_make_zipfile_no_zlib (__main__.ArchiveUtilTestCase) ... ok
test_tarfile_vs_tar (__main__.ArchiveUtilTestCase) ... ok

======================================================================
FAIL: test_compress_deprecated (__main__.ArchiveUtilTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/westley/Projects/cpython/Lib/distutils/tests/test_archive_util.py", line 165, in test_compress_deprecated
    self.assertTrue(os.path.exists(tarball))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 8 tests in 0.203s

FAILED (failures=1)
Traceback (most recent call last):
  File "/home/westley/Projects/cpython/Lib/runpy.py", line 160, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/westley/Projects/cpython/Lib/runpy.py", line 73, in _run_code
    exec(code, run_globals)
  File "/home/westley/Projects/cpython/Lib/distutils/tests/test_archive_util.py", line 248, in <module>
    run_unittest(test_suite())
  File "/home/westley/Projects/cpython/Lib/test/support.py", line 1192, in run_unittest
    _run_suite(suite)
  File "/home/westley/Projects/cpython/Lib/test/support.py", line 1175, in _run_suite
    raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "/home/westley/Projects/cpython/Lib/distutils/tests/test_archive_util.py", line 165, in test_compress_deprecated
    self.assertTrue(os.path.exists(tarball))
AssertionError: False is not true

[101559 refs]
msg132172 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-25 22:31
Okay, verbose mode does not yield more info :)

Is the compress program special on your system?
msg132177 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-03-25 22:46
I may have figured out the problem. The test checks if the archive's extension is '.tar.Z', but the compress command on my computer appends the .gz extension to the file. To my surprise, the gunzip command worked on the file. So the compress command was actually creating gzipped files.
msg132180 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-25 23:08
Funny, that’s the second broken compress program we’re hearing of.  Can you give me the output of platform.linux_distribution() so that we can skip this test on your OS?
msg132182 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-03-25 23:32
('', '', '')

:D

I'm using Arch Linux.
msg132183 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-25 23:33
:D

I know you’re using Arch, but I need a way to get that info from Python to skip the test.
msg132185 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-03-25 23:39
So how do other distros do it?
msg132186 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-26 00:01
In general, we prefer to test for the presence of a feature rather than hard-coding operating systems names.  when this is inevitable, we use sys.platform (say for different BSDs) or platform.linux_distribution (which returns meaningful values for most common distros).  I don’t know how to detect your OS :)

Could you open a feature request to add support for Arch in platform.linux_distribution in 3.3?
msg132759 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-01 16:56
Thanks for opening #11678 for the feature request.  To fix this in all versions, we would need a way to find that the current OS is Arch, and/or that the compress program is faulty.  Do you know how to do that?  Maybe with lsb_release?
msg132769 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-04-01 22:06
I've already got a patch ready for #11678.

As for checking the compress command, perhaps we can accomplish it by comparing version information of the program:


$ compress --version
compress 1.4
Copyright (C) 2007 Free Software Foundation, Inc.
Copyright (C) 1993 Jean-loup Gailly.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.


The last line may be the key. It says Jean-loup Gailly; he invented the gzip compression method, but not the LZW method used by the original compress program.
msg134308 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-23 15:51
Okay.  It’s not a very beautiful check, but it will do.  Do you want to make a patch to disable compress if it’s a fake compress program?
msg143501 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-09-05 01:01
I emailed the Arch Linux people to get more information on this particular issue.  If they decide that the compress program will stay as is I will write attempt to write a patch to skip the test based on the output of compress's --version flag.
msg143620 - (view) Author: Westley Martínez (westley.martinez) * Date: 2011-09-06 16:13
https://bugs.archlinux.org/task/25908

Looks like Allan will be taking care of this problem (eventually).  I think this bug can be closed.
msg143622 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-06 16:16
Thank you for investigating.
History
Date User Action Args
2011-09-06 16:16:45eric.araujosetassignee: tarek -> eric.araujo
resolution: fixed -> wont fix
messages: + msg143622
stage: resolved
2011-09-06 16:13:27westley.martinezsetstatus: open -> closed
resolution: fixed
messages: + msg143620
2011-09-05 01:01:19westley.martinezsetmessages: + msg143501
2011-05-04 16:06:04eric.araujolinkissue11991 superseder
2011-04-23 15:51:38eric.araujosetmessages: + msg134308
2011-04-01 22:06:48westley.martinezsetmessages: + msg132769
2011-04-01 16:56:25eric.araujosettitle: test_distutils fails -> test_distutils fails because of borked compress program
nosy: + alexis

messages: + msg132759

versions: + 3rd party, Python 3.1, Python 2.7, Python 3.2
components: + Distutils2
2011-03-26 00:01:37eric.araujosetmessages: + msg132186
2011-03-25 23:39:43westley.martinezsetmessages: + msg132185
2011-03-25 23:33:32eric.araujosetmessages: + msg132183
2011-03-25 23:32:29westley.martinezsetmessages: + msg132182
2011-03-25 23:08:22eric.araujosetmessages: + msg132180
2011-03-25 22:46:39westley.martinezsetmessages: + msg132177
2011-03-25 22:31:57eric.araujosetmessages: + msg132172
2011-03-25 22:28:32westley.martinezsetmessages: + msg132170
2011-03-25 16:32:26eric.araujosetmessages: + msg132113
2011-03-05 17:42:47westley.martinezsetnosy: brett.cannon, tarek, eric.araujo, westley.martinez
messages: + msg130126
2011-03-05 15:50:50eric.araujosetnosy: + tarek, eric.araujo
messages: + msg130122

assignee: tarek
components: + Distutils, - Tests
2011-02-27 21:05:21brett.cannonsetstatus: pending -> open
nosy: brett.cannon, westley.martinez
messages: + msg129653
2011-02-27 20:38:31brett.cannonsetstatus: open -> pending
nosy: + brett.cannon
messages: + msg129651

2011-02-26 20:29:59westley.martinezcreate