Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious test failure in distutils #52976

Closed
ronaldoussoren opened this issue May 16, 2010 · 8 comments
Closed

Spurious test failure in distutils #52976

ronaldoussoren opened this issue May 16, 2010 · 8 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@ronaldoussoren
Copy link
Contributor

BPO 8730
Nosy @ronaldoussoren, @pitrou, @tarekziade, @merwok, @iritkatriel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/tarekziade'
closed_at = <Date 2020-11-09.00:04:53.115>
created_at = <Date 2010-05-16.12:21:56.440>
labels = ['type-bug', 'library']
title = 'Spurious test failure in distutils'
updated_at = <Date 2020-11-09.00:04:53.113>
user = 'https://github.com/ronaldoussoren'

bugs.python.org fields:

activity = <Date 2020-11-09.00:04:53.113>
actor = 'iritkatriel'
assignee = 'tarek'
closed = True
closed_date = <Date 2020-11-09.00:04:53.115>
closer = 'iritkatriel'
components = ['Distutils']
creation = <Date 2010-05-16.12:21:56.440>
creator = 'ronaldoussoren'
dependencies = []
files = []
hgrepos = []
issue_num = 8730
keywords = []
message_count = 8.0
messages = ['105862', '105864', '105866', '105899', '105900', '105914', '131598', '380566']
nosy_count = 5.0
nosy_names = ['ronaldoussoren', 'pitrou', 'tarek', 'eric.araujo', 'iritkatriel']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue8730'
versions = ['Python 2.7', 'Python 3.2', 'Python 3.3', 'Python 3.4']

@ronaldoussoren
Copy link
Contributor Author

Output of test_distutils on a older SuSE Linux system:

FAILED (errors=1, skipped=5)
Traceback (most recent call last):
  File "../Lib/test/test_distutils.py", line 18, in <module>
    test_main()
  File "../Lib/test/test_distutils.py", line 13, in test_main
    test_support.run_unittest(distutils.tests.test_suite())
  File "/home/xsupport/rtest/python-trunk/Lib/test/test_support.py", line 1038, in run_unittest
    _run_suite(suite)
  File "/home/xsupport/rtest/python-trunk/Lib/test/test_support.py", line 1021, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "/home/xsupport/rtest/python-trunk/Lib/distutils/tests/test_archive_util.py", line 167, in test_compress_deprecated
    make_tarball(base_name, 'dist', compress='compress')
  File "/home/xsupport/rtest/python-trunk/Lib/distutils/archive_util.py", line 116, in make_tarball
    spawn(cmd, dry_run=dry_run)
  File "/home/xsupport/rtest/python-trunk/Lib/distutils/spawn.py", line 34, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/home/xsupport/rtest/python-trunk/Lib/distutils/spawn.py", line 141, in _spawn_posix
    (cmd[0], exit_status)
DistutilsExecError: command 'compress' failed with exit status 1

This system has a fake 'compress' command that only supports uncompress functionality:

$ compress --help
Usage: compress OPTION FILE
Dummy script for uncompressing legacy shar files.
with OPTION in:
      --help      display this help and exit
      --version   output version information and exit

-d uncompress

Use `gzip' for compressing files.

@ronaldoussoren ronaldoussoren added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels May 16, 2010
@tarekziade
Copy link
Mannequin

tarekziade mannequin commented May 16, 2010

ouch, what a bad practice...

The compress feature is going away anyway.

Could you tell me what "compress --version" says ?

Maybe we can use that output to discard this fake command when looking for the compress program.

@ronaldoussoren
Copy link
Contributor Author

$ compress --version
compress - sharutils 4.2c

And yes, this is jucky behavior. Most systems shouldn't be affected by this because sharutils isn't used a lot these days.

@tarekziade
Copy link
Mannequin

tarekziade mannequin commented May 17, 2010

So do you know if this is specific to all sharutils versions ?

I could read the version and raise a specific error in that case.
*or* just not fix this bug and fix the test so it's permissive in this very particular case (by looking at the compression version)

What do you think ?

@pitrou
Copy link
Member

pitrou commented May 17, 2010

Just skip the test, IMO.

@ronaldoussoren
Copy link
Contributor Author

I'd also skip the test, this is not a bug in Python but a broken compress executable.

@merwok
Copy link
Member

merwok commented Mar 21, 2011

Ronald, can you tell what would be the check to put in skipIf?

@iritkatriel
Copy link
Member

The skip has been added:

@unittest.skipUnless(find_executable('compress'),
'The compress program is required')
def test_compress_deprecated(self):

@unittest.skipUnless(find_executable('compress'),

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants