Project

General

Profile

Bug #53478

Updated by Sebastian Wagner over 2 years ago

Trying to run s3-tests and this happens: 

 <pre> 
 $ ../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' 
 </pre> 

 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: 

 <pre> 
   

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

 </pre> 
 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. 

Back