--- Begin Message ---
Package: src:python-launchpadlib
Version: 1.11.0-1
Severity: important
Tags: sid trixie
User: debian-pyt...@lists.debian.org
Usertags: python3.12
python-launchpadlib's autopkg tests fail with Python 3.12:
[...]
177s autopkgtest [20:13:00]: test unittests: [-----------------------
177s === python3.12 ===
178s ============================= test session starts
==============================
178s platform linux -- Python 3.12.0+, pytest-7.4.3, pluggy-1.3.0
178s rootdir: /usr/lib/python3/dist-packages/launchpadlib
178s collected 115 items
178s
178s
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py
. [ 0%]
178s .FFF..FFFFF
[ 10%]
178s
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_http.py .
[ 11%]
178s .........
[ 19%]
178s
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_launchpad.py
. [ 20%]
178s ...............F.............................
[ 59%]
178s
../../../usr/lib/python3/dist-packages/launchpadlib/testing/tests/test_launchpad.py
. [ 60%]
179s ..............................................
[100%]
179s
179s =================================== FAILURES
===================================
179s __
TestUnencryptedFileCredentialStore.test_file_only_contains_one_credential
___
179s
179s self =
<launchpadlib.tests.test_credential_store.TestUnencryptedFileCredentialStore
testMethod=test_file_only_contains_one_credential>
179s
179s def test_file_only_contains_one_credential(self):
179s # A credential file may contain only one credential. If you
179s # write two credentials with different unique IDs to the same
179s # file, the first credential will be overwritten with the
179s # second.
179s credential1 = self.make_credential("consumer key")
179s credential2 = self.make_credential("consumer key2")
179s self.store.save(credential1, "unique key 1")
179s self.store.save(credential1, "unique key 2")
179s > loaded = self.store.load("unique key 1")
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:110:
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s /usr/lib/python3/dist-packages/launchpadlib/credentials.py:345: in load
179s return self.do_load(unique_key)
179s /usr/lib/python3/dist-packages/launchpadlib/credentials.py:486: in
do_load
179s return Credentials.load_from_path(self.filename)
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:226:
in load_from_path
179s credentials.load(credentials_file)
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s
179s self = <launchpadlib.credentials.Credentials object at 0x7ff6bc12eff0>
179s readable_file = <_io.TextIOWrapper name='/tmp/tmps9udu7rw' mode='r'
encoding='UTF-8'>
179s
179s def load(self, readable_file):
179s """Load credentials from a file-like object.
179s
179s This overrides the consumer and access token given in the
constructor
179s and replaces them with the values read from the file.
179s
179s :param readable_file: A file-like object to read the
credentials from
179s :type readable_file: Any object supporting the file-like
`read()`
179s method
179s """
179s # Attempt to load the access token from the file.
179s parser = SafeConfigParser()
179s > reader = getattr(parser, "read_file", parser.readfp)
179s E AttributeError: 'ConfigParser' object has no attribute
'readfp'. Did you mean: 'read'?
179s
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:194:
AttributeError
179s ____________ TestUnencryptedFileCredentialStore.test_save_and_load
_____________
179s
179s self =
<launchpadlib.tests.test_credential_store.TestUnencryptedFileCredentialStore
testMethod=test_save_and_load>
179s
179s def test_save_and_load(self):
179s # Make sure you can save and load credentials to a file.
179s credential = self.make_credential("consumer key")
179s self.store.save(credential, "unique key")
179s > credential2 = self.store.load("unique key")
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:90:
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s /usr/lib/python3/dist-packages/launchpadlib/credentials.py:345: in load
179s return self.do_load(unique_key)
179s /usr/lib/python3/dist-packages/launchpadlib/credentials.py:486: in
do_load
179s return Credentials.load_from_path(self.filename)
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:226:
in load_from_path
179s credentials.load(credentials_file)
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s
179s self = <launchpadlib.credentials.Credentials object at 0x7ff6bc1366c0>
179s readable_file = <_io.TextIOWrapper name='/tmp/tmp8jjpg4c5' mode='r'
encoding='UTF-8'>
179s
179s def load(self, readable_file):
179s """Load credentials from a file-like object.
179s
179s This overrides the consumer and access token given in the
constructor
179s and replaces them with the values read from the file.
179s
179s :param readable_file: A file-like object to read the
credentials from
179s :type readable_file: Any object supporting the file-like
`read()`
179s method
179s """
179s # Attempt to load the access token from the file.
179s parser = SafeConfigParser()
179s > reader = getattr(parser, "read_file", parser.readfp)
179s E AttributeError: 'ConfigParser' object has no attribute
'readfp'. Did you mean: 'read'?
179s
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:194:
AttributeError
179s _______
TestUnencryptedFileCredentialStore.test_unique_id_doesnt_matter ________
179s
179s self =
<launchpadlib.tests.test_credential_store.TestUnencryptedFileCredentialStore
testMethod=test_unique_id_doesnt_matter>
179s
179s def test_unique_id_doesnt_matter(self):
179s # If a file contains a credential, that credential will be
179s # accessed no matter what unique ID you specify.
179s credential = self.make_credential("consumer key")
179s self.store.save(credential, "some key")
179s > credential2 = self.store.load("some other key")
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:98:
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s /usr/lib/python3/dist-packages/launchpadlib/credentials.py:345: in load
179s return self.do_load(unique_key)
179s /usr/lib/python3/dist-packages/launchpadlib/credentials.py:486: in
do_load
179s return Credentials.load_from_path(self.filename)
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:226:
in load_from_path
179s credentials.load(credentials_file)
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s
179s self = <launchpadlib.credentials.Credentials object at 0x7ff6bc134860>
179s readable_file = <_io.TextIOWrapper name='/tmp/tmpafar8xnn' mode='r'
encoding='UTF-8'>
179s
179s def load(self, readable_file):
179s """Load credentials from a file-like object.
179s
179s This overrides the consumer and access token given in the
constructor
179s and replaces them with the values read from the file.
179s
179s :param readable_file: A file-like object to read the
credentials from
179s :type readable_file: Any object supporting the file-like
`read()`
179s method
179s """
179s # Attempt to load the access token from the file.
179s parser = SafeConfigParser()
179s > reader = getattr(parser, "read_file", parser.readfp)
179s E AttributeError: 'ConfigParser' object has no attribute
'readfp'. Did you mean: 'read'?
179s
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:194:
AttributeError
179s ___________ TestKeyringCredentialStore.test_keyring_returns_unicode
____________
179s
179s self =
<launchpadlib.tests.test_credential_store.TestKeyringCredentialStore
testMethod=test_keyring_returns_unicode>
179s
179s def test_keyring_returns_unicode(self):
179s # Kwallet is reported to sometimes return Unicode, which
broke the
179s # credentials parsing. This test ensures a Unicode password is
179s # handled correctly. (See bug lp:877374)
179s class UnicodeInMemoryKeyring(InMemoryKeyring):
179s def get_password(self, service, username):
179s password = super(UnicodeInMemoryKeyring,
self).get_password(
179s service, username
179s )
179s if isinstance(password, unicode_type):
179s password = password.encode("utf-8")
179s return password
179s
179s self.keyring = UnicodeInMemoryKeyring()
179s with fake_keyring(self.keyring):
179s credential = self.make_credential("consumer key")
179s self.assertTrue(credential)
179s # Shouldn't this test actually use a unicodish key?!
179s self.store.save(credential, "unique key")
179s credential2 = self.store.load("unique key")
179s > self.assertTrue(credential2)
179s E AssertionError: None is not true
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:186:
AssertionError
179s _____________ TestKeyringCredentialStore.test_lookup_by_unique_key
_____________
179s
179s self =
<launchpadlib.tests.test_credential_store.TestKeyringCredentialStore
testMethod=test_lookup_by_unique_key>
179s
179s def test_lookup_by_unique_key(self):
179s # Credentials in the keyring are looked up by the unique ID
179s # under which they were stored.
179s with fake_keyring(self.keyring):
179s credential1 = self.make_credential("consumer key1")
179s self.store.save(credential1, "key 1")
179s
179s credential2 = self.make_credential("consumer key2")
179s self.store.save(credential2, "key 2")
179s
179s loaded1 = self.store.load("key 1")
179s > self.assertTrue(loaded1)
179s E AssertionError: None is not true
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:140:
AssertionError
179s ____________ TestKeyringCredentialStore.test_nonencoded_key_handled
____________
179s
179s self =
<launchpadlib.tests.test_credential_store.TestKeyringCredentialStore
testMethod=test_nonencoded_key_handled>
179s
179s def test_nonencoded_key_handled(self):
179s # For backwards compatibility with keys that are not base
64 encoded.
179s
179s class UnencodedInMemoryKeyring(InMemoryKeyring):
179s def get_password(self, service, username):
179s pw = super(UnencodedInMemoryKeyring,
self).get_password(
179s service, username
179s )
179s return b64decode(pw[5:])
179s
179s self.keyring = UnencodedInMemoryKeyring()
179s with fake_keyring(self.keyring):
179s credential = self.make_credential("consumer key")
179s self.store.save(credential, "unique key")
179s credential2 = self.store.load("unique key")
179s > self.assertEqual(credential.consumer.key,
credential2.consumer.key)
179s E AttributeError: 'NoneType' object has no attribute
'consumer'
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:207:
AttributeError
179s __
TestKeyringCredentialStore.test_reused_unique_id_overwrites_old_credential
__
179s
179s self =
<launchpadlib.tests.test_credential_store.TestKeyringCredentialStore
testMethod=test_reused_unique_id_overwrites_old_credential>
179s
179s def test_reused_unique_id_overwrites_old_credential(self):
179s # Writing a credential to the keyring with a given unique ID
179s # will overwrite any credential stored under that ID.
179s
179s with fake_keyring(self.keyring):
179s credential1 = self.make_credential("consumer key1")
179s self.store.save(credential1, "the only key")
179s
179s credential2 = self.make_credential("consumer key2")
179s self.store.save(credential2, "the only key")
179s
179s loaded = self.store.load("the only key")
179s > self.assertEqual(credential2.consumer.key,
loaded.consumer.key)
179s E AttributeError: 'NoneType' object has no attribute
'consumer'
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:158:
AttributeError
179s ________________ TestKeyringCredentialStore.test_save_and_load
_________________
179s
179s self =
<launchpadlib.tests.test_credential_store.TestKeyringCredentialStore
testMethod=test_save_and_load>
179s
179s def test_save_and_load(self):
179s # Make sure you can save and load credentials to a keyring.
179s with fake_keyring(self.keyring):
179s credential = self.make_credential("consumer key")
179s self.store.save(credential, "unique key")
179s credential2 = self.store.load("unique key")
179s > self.assertEqual(credential.consumer.key,
credential2.consumer.key)
179s E AttributeError: 'NoneType' object has no attribute
'consumer'
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py:127:
AttributeError
179s _____________ TestLaunchpadLoginWithCredentialsFile.test_filename
______________
179s
179s self =
<launchpadlib.tests.test_launchpad.TestLaunchpadLoginWithCredentialsFile
testMethod=test_filename>
179s
179s def test_filename(self):
179s ignore, filename = tempfile.mkstemp()
179s launchpad = NoNetworkLaunchpad.login_with(
179s application_name="not important", credentials_file=filename
179s )
179s
179s # The credentials are stored unencrypted in the file you
179s # specify.
179s > credentials = Credentials.load_from_path(filename)
179s
179s
/usr/lib/python3/dist-packages/launchpadlib/tests/test_launchpad.py:291:
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:226:
in load_from_path
179s credentials.load(credentials_file)
179s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
179s
179s self = <launchpadlib.credentials.Credentials object at 0x7ff6bc1353d0>
179s readable_file = <_io.TextIOWrapper name='/tmp/tmp3a0sn296' mode='r'
encoding='UTF-8'>
179s
179s def load(self, readable_file):
179s """Load credentials from a file-like object.
179s
179s This overrides the consumer and access token given in the
constructor
179s and replaces them with the values read from the file.
179s
179s :param readable_file: A file-like object to read the
credentials from
179s :type readable_file: Any object supporting the file-like
`read()`
179s method
179s """
179s # Attempt to load the access token from the file.
179s parser = SafeConfigParser()
179s > reader = getattr(parser, "read_file", parser.readfp)
179s E AttributeError: 'ConfigParser' object has no attribute
'readfp'. Did you mean: 'read'?
179s
179s
/usr/lib/python3/dist-packages/lazr/restfulclient/authorize/oauth.py:194:
AttributeError
179s =============================== warnings summary
===============================
179s
../../../usr/lib/python3/dist-packages/launchpadlib/testing/resources.py:21
179s
/usr/lib/python3/dist-packages/launchpadlib/testing/resources.py:21:
DeprecationWarning: pkg_resources is deprecated as an API. See
https://setuptools.pypa.io/en/latest/pkg_resources.html
179s from pkg_resources import resource_string
179s
179s ../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:2871
179s ../../../usr/lib/python3/dist-packages/pkg_resources/__init__.py:2871
179s /usr/lib/python3/dist-packages/pkg_resources/__init__.py:2871:
DeprecationWarning: Deprecated call to
`pkg_resources.declare_namespace('lazr')`.
179s Implementing implicit namespace packages (as specified in PEP
420) is preferred to `pkg_resources.declare_namespace`. See
https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
179s declare_namespace(pkg)
179s
179s tests/test_http.py: 10 warnings
179s /usr/lib/python3/dist-packages/httplib2/__init__.py:147:
DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
179s context = ssl.SSLContext(DEFAULT_TLS_VERSION)
179s
179s
testing/tests/test_launchpad.py::FakeLaunchpadTest::test_datetime_property
179s
/usr/lib/python3/dist-packages/launchpadlib/testing/tests/test_launchpad.py:170:
DeprecationWarning: datetime.datetime.utcnow() is deprecated and
scheduled for removal in a future version. Use timezone-aware objects to
represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
179s now = datetime.utcnow()
179s
179s ../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:451
179s /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:451:
PytestCacheWarning: could not create cache path
/usr/lib/python3/dist-packages/launchpadlib/.pytest_cache/v/cache/nodeids:
[Errno 13] Permission denied:
'/usr/lib/python3/dist-packages/launchpadlib/.pytest_cache'
179s config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
179s
179s ../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:405
179s /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:405:
PytestCacheWarning: could not create cache path
/usr/lib/python3/dist-packages/launchpadlib/.pytest_cache/v/cache/lastfailed:
[Errno 13] Permission denied:
'/usr/lib/python3/dist-packages/launchpadlib/.pytest_cache'
179s config.cache.set("cache/lastfailed", self.lastfailed)
179s
179s ../../../usr/lib/python3/dist-packages/_pytest/stepwise.py:56
179s /usr/lib/python3/dist-packages/_pytest/stepwise.py:56:
PytestCacheWarning: could not create cache path
/usr/lib/python3/dist-packages/launchpadlib/.pytest_cache/v/cache/stepwise:
[Errno 13] Permission denied:
'/usr/lib/python3/dist-packages/launchpadlib/.pytest_cache'
179s session.config.cache.set(STEPWISE_CACHE_DIR, [])
179s
179s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
179s =========================== short test summary info
============================
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestUnencryptedFileCredentialStore::test_file_only_contains_one_credential
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestUnencryptedFileCredentialStore::test_save_and_load
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestUnencryptedFileCredentialStore::test_unique_id_doesnt_matter
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestKeyringCredentialStore::test_keyring_returns_unicode
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestKeyringCredentialStore::test_lookup_by_unique_key
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestKeyringCredentialStore::test_nonencoded_key_handled
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestKeyringCredentialStore::test_reused_unique_id_overwrites_old_credential
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_credential_store.py::TestKeyringCredentialStore::test_save_and_load
179s FAILED
../../../usr/lib/python3/dist-packages/launchpadlib/tests/test_launchpad.py::TestLaunchpadLoginWithCredentialsFile::test_filename
179s ================== 9 failed, 106 passed, 17 warnings in 1.30s
==================
--- End Message ---