Project

General

Profile

Actions

Bug #53478

open

s3-tests: AttributeError: module 'collections' has no attribute 'Callable'

Added by Pete Zaitcev over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Trying to run s3-tests and this happens:

$ ../qa/workunits/rgw/run-s3tests.sh
..........................
+ S3TEST_CONF=s3tests.conf.SAMPLE
+ virtualenv/bin/python -m nose -a '!fails_on_rgw,!lifecycle_expiration,!fails_strict_rfc2616' -v
Traceback (most recent call last):
  File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtuale
nv/lib/python3.10/site-packages/nose/__main__.py", line 8, in <module>
    run_exit()
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/core.py", line 118, in __init__
    unittest.TestProgram.__init__(
  File "/usr/lib64/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/core.py", line 179, in parseArgs
    self.createTests()  
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/core.py", line 193, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames)
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/loader.py", line 481, in loadTestsFromNames
    return unittest.TestLoader.loadTestsFromNames(self, names, module)
  File "/usr/lib64/python3.10/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python3.10/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/loader.py", line 454, in loadTestsFromName
    return LazySuite(   
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/suite.py", line 53, in __init__
    super(LazySuite, self).__init__()
  File "/usr/lib64/python3.10/unittest/suite.py", line 22, in __init__
    self._tests = []
  File "/home/zaitcev/ceph/ceph-srbac/build/tmp.s3-tests.98344/s3-tests/virtualenv/lib/python3.10/site-packages/nose/suite.py", line 106, in _set_tests
    if isinstance(tests, collections.Callable) and not is_suite:
AttributeError: module 'collections' has no attribute 'Callable'

IIRC this is another py3.10 incompatibility, although the rename was announced a couple of releases back.

Swift's approach is to use abc where needed:

  try:
      from collections.abc import MutableMapping
  except ImportError:
      from collections import MutableMapping  # py2


See https://review.opendev.org/c/openstack/swift/+/814823/2/swift/common/swob.py

I'm going to make a quick fix and file a PR.

Actions #1

Updated by Sebastian Wagner over 2 years ago

  • Project changed from Ceph to rgw-testing
  • Subject changed from AttributeError: module 'collections' has no attribute 'Callable' to s3-tests: AttributeError: module 'collections' has no attribute 'Callable'
  • Description updated (diff)
Actions #2

Updated by Pete Zaitcev over 2 years ago

The root cause of this is the wheel at PyPI:
https://files.pythonhosted.org/packages/15/d8/dd071918c040f50fa1cf80da16423af51ff8ce4a0f2399b7bf8de45ac3d9/nose-1.3.7-py3-none-any.whl
The tarball and github contain a good version. Fedora installs it too, but for some reason we insist on using what pip finds, which fails.

Actions

Also available in: Atom PDF