Traceback (most recent call last):
File "/home/yoh/datalad/datalad/cmd.py", line 537, in close
for source, data in self.generator:
File "<frozen _collections_abc>", line 330, in __next__
File "/home/yoh/datalad/datalad/runner/nonasyncrunner.py", line 97, in send
return self._locked_send(message)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/yoh/datalad/datalad/runner/nonasyncrunner.py", line 122, in _locked_send
self._check_result()
File "/home/yoh/datalad/datalad/runner/nonasyncrunner.py", line 93, in _check_result
self.runner._check_result()
File "/home/yoh/datalad/datalad/runner/nonasyncrunner.py", line 295, in _check_result
raise CommandError(
datalad.runner.exception.CommandError: CommandError: '/home/yoh/venvs/dev3.11/bin/python -i -u -q -' failed with exitcode 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.11/logging/__init__.py", line 1113, in emit
stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
File "/home/yoh/datalad/datalad/cmd.py", line 209, in __del__
self.close()
File "/home/yoh/datalad/datalad/cmd.py", line 551, in close
lgr.error(
Message: '%s subprocess exited with %s (%s)'
Arguments: (BatchedCommand(command=<<['/home/yoh/ve++43 chars++'-']>>, encoding='UTF-8', exception_on_timeout=True, generator=<_ResultGenerator>, last_request="import time; print('a')", output_proc=None, path=None, return_code=None, runner=<WitlessRunner>, stderr_output=b'>>> >>> ', stdin_queue=<Queue>, timeout=0.5, wait_timed_out=None), '1', CommandError(''))
=========================================================== FAILURES ============================================================
________________________________________________ test_datalad_credential_helper _________________________________________________
[gw0] linux -- Python 3.11.2 /home/yoh/venvs/dev3.11/bin/python
path = '/tmp/datalad_temp_test_datalad_credential_helperyaookelr'
@with_tempfile
def test_datalad_credential_helper(path=None):
ds = Dataset(path).create()
# tell git to use git-credential-datalad
ds.config.add('credential.helper', 'datalad', scope='local')
ds.config.add('datalad.credentials.githelper.noninteractive', 'true',
scope='global')
from datalad.downloaders.providers import Providers
url1 = "https://datalad-test.org/some"
url2 = "https://datalad-test.org/other"
provider_name = "datalad-test.org"
# `Providers` code is old and only considers a dataset root based on PWD
# for config lookup. contextmanager below can be removed once the
# provider/credential system is redesigned.
with chpwd(ds.path):
gitcred = GitCredentialInterface(url=url1, repo=ds)
# There's nothing set up yet, helper should return empty
gitcred.fill()
eq_(gitcred['username'], '')
eq_(gitcred['password'], '')
# store new credentials
# Note, that `Providers.enter_new()` currently uses user-level config
# files for storage only. TODO: make that an option!
# To not mess with existing ones, fail if it already exists:
cfg_file = Path(Providers._get_providers_dirs()['user']) \
/ f"{provider_name}.cfg"
assert_false(cfg_file.exists())
# Make sure we clean up
from datalad.tests import _TEMP_PATHS_GENERATED
_TEMP_PATHS_GENERATED.append(str(cfg_file))
# Give credentials to git and ask it to store them:
gitcred = GitCredentialInterface(url=url1, username="dl-user",
password="dl-pwd", repo=ds)
gitcred.approve()
assert_true(cfg_file.exists())
providers = Providers.from_config_files()
p1 = providers.get_provider(url=url1, only_nondefault=True)
> assert_is_instance(p1.credential, UserPassword)
E AttributeError: 'NoneType' object has no attribute 'credential'
datalad/local/tests/test_gitcredential.py:122: AttributeError
----------------------------------------------------- Captured stdout call ------------------------------------------------------
create(ok): . (dataset)
======================================================= warnings summary ========================================================
@adswa summarized observing it on #7340 (comment)
I have ran into it on a fresh (woohoo -- a new laptop) box in a sample run of
pytest -n10 -v datalad(done in 2 minutes)details
previously we had possibly related #7165 which was addressed by #7209
WTF on that box (shows that I do not even have git user configured)
It is highly recommended to configure Git before using DataLad. Set both 'user.name' and 'user.email' configuration variables.
WTF
configuration <SENSITIVE, report disabled by configuration>
credentials
datalad
dataset
dependencies
environment
extensions
git-annex
location
python
system
but an annoying part is that rerunning the failed tests -- ie this only one -- passes it after!
so likely it is some annoying interplay with having plain keyring just established or smth?