0s autopkgtest [08:21:13]: starting date and time: 2024-11-13 08:21:13+0000 0s autopkgtest [08:21:13]: git checkout: 6f3be7a8 Fix armhf LXD image generation for plucky 0s autopkgtest [08:21:13]: host juju-7f2275-prod-proposed-migration-environment-15; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.6hivkd6a/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:python3-defaults,src:python3-stdlib-extensions --apt-upgrade duecredit --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 '--env=ADT_TEST_TRIGGERS=python3-defaults/3.12.7-1 python3-stdlib-extensions/3.12.7-1' -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor builder-cpu2-ram4-disk20 --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-15@bos03-1.secgroup --name adt-plucky-amd64-duecredit-20241113-082113-juju-7f2275-prod-proposed-migration-environment-15-d96ba319-01c8-4a7a-bd5b-03d5340f4d2c --image adt/ubuntu-plucky-amd64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-15 --net-id=net_prod-proposed-migration-amd64 -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 48s autopkgtest [08:22:01]: testbed dpkg architecture: amd64 48s autopkgtest [08:22:01]: testbed apt version: 2.9.8 48s autopkgtest [08:22:01]: @@@@@@@@@@@@@@@@@@@@ test bed setup 49s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [73.9 kB] 49s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [849 kB] 49s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.3 kB] 49s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [76.4 kB] 49s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/restricted Sources [7016 B] 49s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 Packages [111 kB] 49s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main i386 Packages [65.2 kB] 49s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/restricted amd64 Packages [32.6 kB] 49s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/universe i386 Packages [255 kB] 49s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/universe amd64 Packages [637 kB] 49s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse i386 Packages [13.0 kB] 49s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse amd64 Packages [37.7 kB] 49s Fetched 2173 kB in 1s (2776 kB/s) 49s Reading package lists... 52s Reading package lists... 52s Building dependency tree... 52s Reading state information... 52s Calculating upgrade... 52s The following NEW packages will be installed: 52s python3.13-gdbm 52s The following packages will be upgraded: 52s libgpgme11t64 libpython3-stdlib python3 python3-gdbm python3-minimal 52s 5 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 52s Need to get 253 kB of archives. 52s After this operation, 147 kB of additional disk space will be used. 52s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 python3-minimal amd64 3.12.7-1 [27.4 kB] 52s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 python3 amd64 3.12.7-1 [24.0 kB] 52s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 libpython3-stdlib amd64 3.12.7-1 [10.0 kB] 52s Get:4 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.13-gdbm amd64 3.13.0-2 [31.3 kB] 52s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 python3-gdbm amd64 3.12.7-1 [8642 B] 52s Get:6 http://ftpmaster.internal/ubuntu plucky/main amd64 libgpgme11t64 amd64 1.23.2-5ubuntu4 [152 kB] 53s Fetched 253 kB in 0s (608 kB/s) 53s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 75541 files and directories currently installed.) 53s Preparing to unpack .../python3-minimal_3.12.7-1_amd64.deb ... 53s Unpacking python3-minimal (3.12.7-1) over (3.12.6-0ubuntu1) ... 53s Setting up python3-minimal (3.12.7-1) ... 53s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 75541 files and directories currently installed.) 53s Preparing to unpack .../python3_3.12.7-1_amd64.deb ... 53s Unpacking python3 (3.12.7-1) over (3.12.6-0ubuntu1) ... 53s Preparing to unpack .../libpython3-stdlib_3.12.7-1_amd64.deb ... 53s Unpacking libpython3-stdlib:amd64 (3.12.7-1) over (3.12.6-0ubuntu1) ... 53s Selecting previously unselected package python3.13-gdbm. 53s Preparing to unpack .../python3.13-gdbm_3.13.0-2_amd64.deb ... 53s Unpacking python3.13-gdbm (3.13.0-2) ... 53s Preparing to unpack .../python3-gdbm_3.12.7-1_amd64.deb ... 53s Unpacking python3-gdbm:amd64 (3.12.7-1) over (3.12.6-1ubuntu1) ... 53s Preparing to unpack .../libgpgme11t64_1.23.2-5ubuntu4_amd64.deb ... 53s Unpacking libgpgme11t64:amd64 (1.23.2-5ubuntu4) over (1.18.0-4.1ubuntu4) ... 53s Setting up libgpgme11t64:amd64 (1.23.2-5ubuntu4) ... 53s Setting up python3.13-gdbm (3.13.0-2) ... 53s Setting up libpython3-stdlib:amd64 (3.12.7-1) ... 53s Setting up python3 (3.12.7-1) ... 54s Setting up python3-gdbm:amd64 (3.12.7-1) ... 54s Processing triggers for man-db (2.12.1-3) ... 54s Processing triggers for libc-bin (2.40-1ubuntu3) ... 54s Reading package lists... 55s Building dependency tree... 55s Reading state information... 55s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 55s Hit:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease 55s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 55s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 55s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 56s Reading package lists... 56s Reading package lists... 56s Building dependency tree... 56s Reading state information... 57s Calculating upgrade... 57s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 57s Reading package lists... 57s Building dependency tree... 57s Reading state information... 57s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 60s autopkgtest [08:22:13]: testbed running kernel: Linux 6.11.0-8-generic #8-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 16 13:41:20 UTC 2024 60s autopkgtest [08:22:13]: @@@@@@@@@@@@@@@@@@@@ apt-source duecredit 62s Get:1 http://ftpmaster.internal/ubuntu plucky/universe duecredit 0.10.2-2 (dsc) [2238 B] 62s Get:2 http://ftpmaster.internal/ubuntu plucky/universe duecredit 0.10.2-2 (tar) [84.3 kB] 62s Get:3 http://ftpmaster.internal/ubuntu plucky/universe duecredit 0.10.2-2 (diff) [4296 B] 62s gpgv: Signature made Sun Sep 22 22:39:02 2024 UTC 62s gpgv: using RSA key 8F6DE104377F3B11E741748731F3144544A1741A 62s gpgv: issuer "tchet@debian.org" 62s gpgv: Can't check signature: No public key 62s dpkg-source: warning: cannot verify inline signature for ./duecredit_0.10.2-2.dsc: no acceptable signature found 62s autopkgtest [08:22:15]: testing package duecredit version 0.10.2-2 62s autopkgtest [08:22:15]: build not needed 62s autopkgtest [08:22:15]: test command1: preparing testbed 63s Reading package lists... 64s Building dependency tree... 64s Reading state information... 64s Starting pkgProblemResolver with broken count: 0 64s Starting 2 pkgProblemResolver with broken count: 0 64s Done 64s The following additional packages will be installed: 64s libpython3.13-minimal libpython3.13-stdlib libxslt1.1 python3-all 64s python3-citeproc python3-duecredit python3-iniconfig python3-looseversion 64s python3-lxml python3-packaging python3-pluggy python3-pytest python3.13 64s python3.13-minimal 64s Suggested packages: 64s python-lxml-doc python3.13-venv python3.13-doc binfmt-support 64s Recommended packages: 64s python3-bs4 python3-cssselect python3-html5lib 64s The following NEW packages will be installed: 64s autopkgtest-satdep libpython3.13-minimal libpython3.13-stdlib libxslt1.1 64s python3-all python3-citeproc python3-duecredit python3-iniconfig 64s python3-looseversion python3-lxml python3-packaging python3-pluggy 64s python3-pytest python3.13 python3.13-minimal 64s 0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded. 64s Need to get 7837 kB/7838 kB of archives. 64s After this operation, 30.8 MB of additional disk space will be used. 64s Get:1 /tmp/autopkgtest.fcwJ2f/1-autopkgtest-satdep.deb autopkgtest-satdep amd64 0 [720 B] 64s Get:2 http://ftpmaster.internal/ubuntu plucky/main amd64 libpython3.13-minimal amd64 3.13.0-2 [879 kB] 65s Get:3 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.13-minimal amd64 3.13.0-2 [2188 kB] 65s Get:4 http://ftpmaster.internal/ubuntu plucky/main amd64 libpython3.13-stdlib amd64 3.13.0-2 [2107 kB] 65s Get:5 http://ftpmaster.internal/ubuntu plucky/main amd64 libxslt1.1 amd64 1.1.39-0exp1ubuntu1 [169 kB] 65s Get:6 http://ftpmaster.internal/ubuntu plucky/main amd64 python3.13 amd64 3.13.0-2 [719 kB] 65s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main amd64 python3-all amd64 3.12.7-1 [890 B] 65s Get:8 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-lxml amd64 5.3.0-1 [1282 kB] 65s Get:9 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-citeproc all 0.6.0-3 [98.4 kB] 65s Get:10 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-looseversion all 1.3.0-3 [8354 B] 65s Get:11 http://ftpmaster.internal/ubuntu plucky/main amd64 python3-packaging all 24.1-1 [41.4 kB] 65s Get:12 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-duecredit all 0.10.2-2 [66.0 kB] 65s Get:13 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-iniconfig all 1.1.1-2 [6024 B] 65s Get:14 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pluggy all 1.5.0-1 [21.0 kB] 65s Get:15 http://ftpmaster.internal/ubuntu plucky/universe amd64 python3-pytest all 8.3.3-1 [251 kB] 65s Fetched 7837 kB in 1s (9350 kB/s) 65s Selecting previously unselected package libpython3.13-minimal:amd64. 65s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 75548 files and directories currently installed.) 65s Preparing to unpack .../00-libpython3.13-minimal_3.13.0-2_amd64.deb ... 65s Unpacking libpython3.13-minimal:amd64 (3.13.0-2) ... 66s Selecting previously unselected package python3.13-minimal. 66s Preparing to unpack .../01-python3.13-minimal_3.13.0-2_amd64.deb ... 66s Unpacking python3.13-minimal (3.13.0-2) ... 66s Selecting previously unselected package libpython3.13-stdlib:amd64. 66s Preparing to unpack .../02-libpython3.13-stdlib_3.13.0-2_amd64.deb ... 66s Unpacking libpython3.13-stdlib:amd64 (3.13.0-2) ... 66s Selecting previously unselected package libxslt1.1:amd64. 66s Preparing to unpack .../03-libxslt1.1_1.1.39-0exp1ubuntu1_amd64.deb ... 66s Unpacking libxslt1.1:amd64 (1.1.39-0exp1ubuntu1) ... 66s Selecting previously unselected package python3.13. 66s Preparing to unpack .../04-python3.13_3.13.0-2_amd64.deb ... 66s Unpacking python3.13 (3.13.0-2) ... 66s Selecting previously unselected package python3-all. 66s Preparing to unpack .../05-python3-all_3.12.7-1_amd64.deb ... 66s Unpacking python3-all (3.12.7-1) ... 66s Selecting previously unselected package python3-lxml:amd64. 66s Preparing to unpack .../06-python3-lxml_5.3.0-1_amd64.deb ... 66s Unpacking python3-lxml:amd64 (5.3.0-1) ... 66s Selecting previously unselected package python3-citeproc. 66s Preparing to unpack .../07-python3-citeproc_0.6.0-3_all.deb ... 66s Unpacking python3-citeproc (0.6.0-3) ... 66s Selecting previously unselected package python3-looseversion. 66s Preparing to unpack .../08-python3-looseversion_1.3.0-3_all.deb ... 66s Unpacking python3-looseversion (1.3.0-3) ... 66s Selecting previously unselected package python3-packaging. 66s Preparing to unpack .../09-python3-packaging_24.1-1_all.deb ... 66s Unpacking python3-packaging (24.1-1) ... 66s Selecting previously unselected package python3-duecredit. 66s Preparing to unpack .../10-python3-duecredit_0.10.2-2_all.deb ... 66s Unpacking python3-duecredit (0.10.2-2) ... 66s Selecting previously unselected package python3-iniconfig. 66s Preparing to unpack .../11-python3-iniconfig_1.1.1-2_all.deb ... 66s Unpacking python3-iniconfig (1.1.1-2) ... 66s Selecting previously unselected package python3-pluggy. 66s Preparing to unpack .../12-python3-pluggy_1.5.0-1_all.deb ... 66s Unpacking python3-pluggy (1.5.0-1) ... 66s Selecting previously unselected package python3-pytest. 66s Preparing to unpack .../13-python3-pytest_8.3.3-1_all.deb ... 66s Unpacking python3-pytest (8.3.3-1) ... 66s Selecting previously unselected package autopkgtest-satdep. 66s Preparing to unpack .../14-1-autopkgtest-satdep.deb ... 66s Unpacking autopkgtest-satdep (0) ... 66s Setting up python3-iniconfig (1.1.1-2) ... 66s Setting up libpython3.13-minimal:amd64 (3.13.0-2) ... 66s Setting up python3-packaging (24.1-1) ... 66s Setting up python3-pluggy (1.5.0-1) ... 67s Setting up python3-looseversion (1.3.0-3) ... 67s Setting up libxslt1.1:amd64 (1.1.39-0exp1ubuntu1) ... 67s Setting up python3.13-minimal (3.13.0-2) ... 67s Setting up libpython3.13-stdlib:amd64 (3.13.0-2) ... 67s Setting up python3.13 (3.13.0-2) ... 68s Setting up python3-pytest (8.3.3-1) ... 69s Setting up python3-all (3.12.7-1) ... 69s Setting up python3-lxml:amd64 (5.3.0-1) ... 69s Setting up python3-citeproc (0.6.0-3) ... 69s Setting up python3-duecredit (0.10.2-2) ... 69s Setting up autopkgtest-satdep (0) ... 69s Processing triggers for systemd (256.5-2ubuntu4) ... 69s Processing triggers for man-db (2.12.1-3) ... 70s Processing triggers for libc-bin (2.40-1ubuntu3) ... 72s (Reading database ... 76751 files and directories currently installed.) 72s Removing autopkgtest-satdep (0) ... 73s autopkgtest [08:22:26]: test command1: for py in `py3versions -s`; do $py -m pytest -k "not test_import_doi" /usr/lib/python3/dist-packages/duecredit/tests; done 73s autopkgtest [08:22:26]: test command1: [----------------------- 74s ============================= test session starts ============================== 74s platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 74s rootdir: /usr/lib/python3/dist-packages/duecredit/tests 74s plugins: typeguard-4.4.1 74s collected 76 items / 1 deselected / 75 selected 74s 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test__main__.py . [ 1%] 74s .. [ 4%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_api.py .. [ 6%] 74s .ssssssss [ 18%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_cmdline.py . [ 20%] 74s .... [ 25%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_collector.py . [ 26%] 74s ........ [ 37%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_dueswitch.py . [ 38%] 74s . [ 40%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_entries.py . [ 41%] 74s . [ 42%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_injections.py . [ 44%] 74s .....ss........... [ 68%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py ... [ 72%] 74s .FF....FF. [ 85%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_utils.py . [ 86%] 74s [ 86%] 74s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_versions.py . [ 88%] 74s .ssssssss [100%] 74s 74s =================================== FAILURES =================================== 74s _______________________________ test_text_output _______________________________ 74s 74s bibtex_entry = BibTeX("@ARTICLE{XXX0,\n author = {Halchenko, Yaroslav O. and Hanke, Michael},\n title = {Open is not enough. Let{'}...mber = {00022},\n doi = {10.3389/fninf.2012.00022},\n issn = {1662-5196},\n localfile = {HH12.pdf},\n}", key='XXX0') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s > import citeproc as cp 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:299: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s /usr/lib/python3/dist-packages/citeproc/__init__.py:45: in 74s from .frontend import CitationStylesStyle, CitationStylesBibliography 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s 74s import os 74s 74s from warnings import warn 74s 74s > from lxml import etree 74s E ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/citeproc/frontend.py:6: ImportError 74s 74s During handling of the above exception, another exception occurred: 74s 74s def test_text_output() -> None: 74s entry = BibTeX(_sample_bibtex) 74s entry2 = BibTeX(_sample_bibtex2) 74s 74s # in this case, since we're not citing any module or method, we shouldn't 74s # output anything 74s collector = DueCreditCollector() 74s collector.cite(entry, path="package") 74s 74s strio = StringIO() 74s TextOutput(strio, collector).dump(tags=["*"]) 74s value = strio.getvalue() 74s assert "0 packages cited" in value, "value was %s" % value 74s assert "0 modules cited" in value, "value was %s" % value 74s assert "0 functions cited" in value, "value was %s" % value 74s 74s # but it should be cited if cite_module=True 74s collector = DueCreditCollector() 74s collector.cite(entry, path="package", cite_module=True) 74s 74s strio = StringIO() 74s > TextOutput(strio, collector).dump(tags=["*"]) 74s 74s /usr/lib/python3/dist-packages/duecredit/tests/test_io.py:306: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s /usr/lib/python3/dist-packages/duecredit/io.py:247: in dump 74s self.fd.write(get_text_rendering(cit.entry, style=self.style)) 74s /usr/lib/python3/dist-packages/duecredit/io.py:256: in get_text_rendering 74s return format_bibtex(entry, style=style) 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s bibtex_entry = BibTeX("@ARTICLE{XXX0,\n author = {Halchenko, Yaroslav O. and Hanke, Michael},\n title = {Open is not enough. Let{'}...mber = {00022},\n doi = {10.3389/fninf.2012.00022},\n issn = {1662-5196},\n localfile = {HH12.pdf},\n}", key='XXX0') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s import citeproc as cp 74s from citeproc.source.bibtex import BibTeX as cpBibTeX 74s except ImportError as e: 74s > raise RuntimeError( 74s "For formatted output we need citeproc and all of its dependencies " 74s "(such as lxml) but there is a problem while importing citeproc: %s" 74s % str(e) 74s ) 74s E RuntimeError: For formatted output we need citeproc and all of its dependencies (such as lxml) but there is a problem while importing citeproc: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:302: RuntimeError 74s _______________________ test_text_output_dump_formatting _______________________ 74s 74s bibtex_entry = BibTeX("@ARTICLE{XXX0,\n author = {Halchenko, Yaroslav O. and Hanke, Michael},\n title = {Open is not enough. Let{'}...mber = {00022},\n doi = {10.3389/fninf.2012.00022},\n issn = {1662-5196},\n localfile = {HH12.pdf},\n}", key='XXX0') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s > import citeproc as cp 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:299: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s /usr/lib/python3/dist-packages/citeproc/__init__.py:45: in 74s from .frontend import CitationStylesStyle, CitationStylesBibliography 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s 74s import os 74s 74s from warnings import warn 74s 74s > from lxml import etree 74s E ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/citeproc/frontend.py:6: ImportError 74s 74s During handling of the above exception, another exception occurred: 74s 74s def test_text_output_dump_formatting() -> None: 74s due = DueCreditCollector() 74s 74s # XXX: atm just to see if it spits out stuff 74s @due.dcite( 74s BibTeX(_sample_bibtex), 74s description="solution to life", 74s path="mymodule", 74s version="0.0.16", 74s ) 74s def mymodule(arg1: Any, kwarg2: Any = "blah") -> Any: 74s """docstring""" 74s assert arg1 == "magical" 74s assert kwarg2 == 1 74s 74s @due.dcite( 74s BibTeX(_sample_bibtex2), 74s description="solution to life", 74s path="mymodule:myfunction", 74s ) 74s def myfunction(arg42): 74s pass 74s 74s myfunction("argh") 74s return "load" 74s 74s # check we don't have anything output 74s strio = StringIO() 74s TextOutput(strio, due).dump(tags=["*"]) 74s value = strio.getvalue() 74s assert "0 modules cited" in value, f"value was {value}" 74s assert "0 functions cited" in value, f"value was {value}" 74s 74s # now we call it -- check it prints stuff 74s strio = StringIO() 74s mymodule("magical", kwarg2=1) 74s > TextOutput(strio, due).dump(tags=["*"]) 74s 74s /usr/lib/python3/dist-packages/duecredit/tests/test_io.py:381: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s /usr/lib/python3/dist-packages/duecredit/io.py:247: in dump 74s self.fd.write(get_text_rendering(cit.entry, style=self.style)) 74s /usr/lib/python3/dist-packages/duecredit/io.py:256: in get_text_rendering 74s return format_bibtex(entry, style=style) 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s bibtex_entry = BibTeX("@ARTICLE{XXX0,\n author = {Halchenko, Yaroslav O. and Hanke, Michael},\n title = {Open is not enough. Let{'}...mber = {00022},\n doi = {10.3389/fninf.2012.00022},\n issn = {1662-5196},\n localfile = {HH12.pdf},\n}", key='XXX0') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s import citeproc as cp 74s from citeproc.source.bibtex import BibTeX as cpBibTeX 74s except ImportError as e: 74s > raise RuntimeError( 74s "For formatted output we need citeproc and all of its dependencies " 74s "(such as lxml) but there is a problem while importing citeproc: %s" 74s % str(e) 74s ) 74s E RuntimeError: For formatted output we need citeproc and all of its dependencies (such as lxml) but there is a problem while importing citeproc: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:302: RuntimeError 74s ________________________ test_format_bibtex_zenodo_doi _________________________ 74s 74s bibtex_entry = BibTeX('@data{0b1284ba-5ce5-4367-84f3-c44b4962ad90,\n doi = {10.5281/zenodo.50186},\n url = {https://doi.org/10....ipype: Release candidate 1 for version 0.12.0},\n year = {2016}\n }', key='0b1284ba-5ce5-4367-84f3-c44b4962ad90') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s > import citeproc as cp 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:299: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s /usr/lib/python3/dist-packages/citeproc/__init__.py:45: in 74s from .frontend import CitationStylesStyle, CitationStylesBibliography 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s 74s import os 74s 74s from warnings import warn 74s 74s > from lxml import etree 74s E ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/citeproc/frontend.py:6: ImportError 74s 74s During handling of the above exception, another exception occurred: 74s 74s def test_format_bibtex_zenodo_doi() -> None: 74s """ 74s test that we can correctly parse bibtex entries obtained from a zenodo doi 74s """ 74s # this was fetched on 2016-05-10 74s bibtex_zenodo = """ 74s @data{0b1284ba-5ce5-4367-84f3-c44b4962ad90, 74s doi = {10.5281/zenodo.50186}, 74s url = {https://doi.org/10.5281/zenodo.50186}, 74s author = {Satrajit Ghosh; Chris Filo Gorgolewski; Oscar Esteban; 74s Erik Ziegler; David Ellis; cindeem; Michael Waskom; Dav Clark; Michael; 74s Fred Loney; Alexandre M. S.; Michael Notter; Hans Johnson; 74s Anisha Keshavan; Yaroslav Halchenko; Carlo Hamalainen; Blake Dewey; 74s Ben Cipollini; Daniel Clark; Julia Huntenburg; Drew Erickson; 74s Michael Hanke; moloney; Jason W; Demian Wassermann; cdla; 74s Nolan Nichols; Chris Markiewicz; Jarrod Millman; Arman Eshaghi; }, 74s publisher = {Zenodo}, 74s title = {nipype: Release candidate 1 for version 0.12.0}, 74s year = {2016} 74s } 74s """ 74s > assert ( 74s format_bibtex(BibTeX(bibtex_zenodo)) 74s == """Ghosh, S. et al., 2016. nipype: Release candidate 1 for version 0.12.0.""" 74s ) 74s 74s /usr/lib/python3/dist-packages/duecredit/tests/test_io.py:612: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s bibtex_entry = BibTeX('@data{0b1284ba-5ce5-4367-84f3-c44b4962ad90,\n doi = {10.5281/zenodo.50186},\n url = {https://doi.org/10....ipype: Release candidate 1 for version 0.12.0},\n year = {2016}\n }', key='0b1284ba-5ce5-4367-84f3-c44b4962ad90') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s import citeproc as cp 74s from citeproc.source.bibtex import BibTeX as cpBibTeX 74s except ImportError as e: 74s > raise RuntimeError( 74s "For formatted output we need citeproc and all of its dependencies " 74s "(such as lxml) but there is a problem while importing citeproc: %s" 74s % str(e) 74s ) 74s E RuntimeError: For formatted output we need citeproc and all of its dependencies (such as lxml) but there is a problem while importing citeproc: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:302: RuntimeError 74s ____________________ test_format_bibtex_with_utf_characters ____________________ 74s 74s bibtex_entry = BibTeX('@misc{https://doi.org/10.5281/zenodo.60847,\n doi = {10.5281/zenodo.60847},\n url = {http://zenodo.org/recor...\n title = {nibabel 2.0.1},\n publisher = {Zenodo},\n year = {2015}\n}', key='https://doi.org/10.5281/zenodo.60847') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s > import citeproc as cp 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:299: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s /usr/lib/python3/dist-packages/citeproc/__init__.py:45: in 74s from .frontend import CitationStylesStyle, CitationStylesBibliography 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s 74s import os 74s 74s from warnings import warn 74s 74s > from lxml import etree 74s E ImportError: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/citeproc/frontend.py:6: ImportError 74s 74s During handling of the above exception, another exception occurred: 74s 74s def test_format_bibtex_with_utf_characters() -> None: 74s """ 74s test that we can correctly parse bibtex entry if it contains utf-8 characters 74s """ 74s # this was fetched on 2017-08-16 74s # replaced Brett with Brótt to have utf-8 characters in first author's name as well 74s bibtex_utf8 = ( 74s "@misc{https://doi.org/10.5281/zenodo.60847,\n doi = {10.5281/zenodo.60847},\n url = {" 74s "http://zenodo.org/record/60847},\n author = {Brótt, Matthew and Hanke, Michael and Cipollini, " 74s "Ben and {Marc-Alexandre Côté} and Markiewicz, Chris and Gerhard, Stephan and Larson, " 74s "Eric and Lee, Gregory R. and Halchenko, Yaroslav and Kastman, Erik and {Cindeem} and Morency, " 74s "Félix C. and {Moloney} and Millman, Jarrod and Rokem, Ariel and {Jaeilepp} and Gramfort, " 74s "Alexandre and Bosch, Jasper J.F. Van Den and {Krish Subramaniam} and Nichols, Nolan and {Embaker} " 74s "and {Bpinsard} and {Chaselgrove} and Oosterhof, Nikolaas N. and St-Jean, Samuel and {Bago " 74s "Amirbekian} and Nimmo-Smith, Ian and {Satrajit Ghosh}},\n keywords = {},\n title = {nibabel " 74s "2.0.1},\n publisher = {Zenodo},\n year = {2015}\n} " 74s ) 74s > assert ( 74s format_bibtex(BibTeX(bibtex_utf8)) == "Brótt, M. et al., 2015. nibabel 2.0.1." 74s ) 74s 74s /usr/lib/python3/dist-packages/duecredit/tests/test_io.py:635: 74s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 74s 74s bibtex_entry = BibTeX('@misc{https://doi.org/10.5281/zenodo.60847,\n doi = {10.5281/zenodo.60847},\n url = {http://zenodo.org/recor...\n title = {nibabel 2.0.1},\n publisher = {Zenodo},\n year = {2015}\n}', key='https://doi.org/10.5281/zenodo.60847') 74s style = 'harvard1' 74s 74s def format_bibtex(bibtex_entry: BibTeX, style: str = "harvard1") -> str: 74s try: 74s import citeproc as cp 74s from citeproc.source.bibtex import BibTeX as cpBibTeX 74s except ImportError as e: 74s > raise RuntimeError( 74s "For formatted output we need citeproc and all of its dependencies " 74s "(such as lxml) but there is a problem while importing citeproc: %s" 74s % str(e) 74s ) 74s E RuntimeError: For formatted output we need citeproc and all of its dependencies (such as lxml) but there is a problem while importing citeproc: cannot import name 'etree' from 'lxml' (/usr/lib/python3/dist-packages/lxml/__init__.py) 74s 74s /usr/lib/python3/dist-packages/duecredit/io.py:302: RuntimeError 74s =============================== warnings summary =============================== 74s ../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475 74s /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /usr/lib/python3/dist-packages/duecredit/tests/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/duecredit/tests/pytest-cache-files-gewowd6k' 74s config.cache.set("cache/nodeids", sorted(self.cached_nodeids)) 74s 74s ../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429 74s /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /usr/lib/python3/dist-packages/duecredit/tests/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/duecredit/tests/pytest-cache-files-6ell0zma' 74s config.cache.set("cache/lastfailed", self.lastfailed) 74s 74s ../../../../usr/lib/python3/dist-packages/_pytest/stepwise.py:51 74s /usr/lib/python3/dist-packages/_pytest/stepwise.py:51: PytestCacheWarning: could not create cache path /usr/lib/python3/dist-packages/duecredit/tests/.pytest_cache/v/cache/stepwise: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/duecredit/tests/pytest-cache-files-5p6h617s' 74s session.config.cache.set(STEPWISE_CACHE_DIR, []) 74s 74s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 74s =========================== short test summary info ============================ 74s FAILED ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py::test_text_output 74s FAILED ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py::test_text_output_dump_formatting 74s FAILED ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py::test_format_bibtex_zenodo_doi 74s FAILED ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py::test_format_bibtex_with_utf_characters 74s ====== 4 failed, 53 passed, 18 skipped, 1 deselected, 3 warnings in 0.56s ====== 75s autopkgtest [08:22:28]: test command1: -----------------------] 75s autopkgtest [08:22:28]: test command1: - - - - - - - - - - results - - - - - - - - - - 75s command1 FAIL non-zero exit status 1 76s autopkgtest [08:22:29]: test command2: preparing testbed 78s Reading package lists... 78s Building dependency tree... 78s Reading state information... 79s Starting pkgProblemResolver with broken count: 0 79s Starting 2 pkgProblemResolver with broken count: 0 79s Done 79s The following NEW packages will be installed: 79s autopkgtest-satdep 79s 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 79s Need to get 0 B/720 B of archives. 79s After this operation, 0 B of additional disk space will be used. 79s Get:1 /tmp/autopkgtest.fcwJ2f/2-autopkgtest-satdep.deb autopkgtest-satdep amd64 0 [720 B] 80s Selecting previously unselected package autopkgtest-satdep. 80s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 76751 files and directories currently installed.) 80s Preparing to unpack .../2-autopkgtest-satdep.deb ... 80s Unpacking autopkgtest-satdep (0) ... 80s Setting up autopkgtest-satdep (0) ... 82s (Reading database ... 76751 files and directories currently installed.) 82s Removing autopkgtest-satdep (0) ... 83s autopkgtest [08:22:36]: test command2: for py in `py3versions -s`; do $py -m pytest -k test_import_doi /usr/lib/python3/dist-packages/duecredit/tests; done 83s autopkgtest [08:22:36]: test command2: [----------------------- 83s ============================= test session starts ============================== 83s platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 83s rootdir: /usr/lib/python3/dist-packages/duecredit/tests 83s plugins: typeguard-4.4.1 83s collected 76 items / 75 deselected / 1 selected 83s 84s ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py F [100%] 84s 84s =================================== FAILURES =================================== 84s _______________________________ test_import_doi ________________________________ 84s 84s self = 84s method = 'GET', url = '/10.1038/nrd842', body = None 84s headers = {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/x-bibtex; charset=utf-8', 'Connection': 'keep-alive'} 84s retries = Retry(total=0, connect=None, read=False, redirect=None, status=None) 84s redirect = False, assert_same_host = False 84s timeout = Timeout(connect=None, read=None, total=None), pool_timeout = None 84s release_conn = False, chunked = False, body_pos = None, preload_content = False 84s decode_content = False, response_kw = {} 84s parsed_url = Url(scheme=None, auth=None, host=None, port=None, path='/10.1038/nrd842', query=None, fragment=None) 84s destination_scheme = None, conn = None, release_this_conn = True 84s http_tunnel_required = True, err = None, clean_exit = False 84s 84s def urlopen( # type: ignore[override] 84s self, 84s method: str, 84s url: str, 84s body: _TYPE_BODY | None = None, 84s headers: typing.Mapping[str, str] | None = None, 84s retries: Retry | bool | int | None = None, 84s redirect: bool = True, 84s assert_same_host: bool = True, 84s timeout: _TYPE_TIMEOUT = _DEFAULT_TIMEOUT, 84s pool_timeout: int | None = None, 84s release_conn: bool | None = None, 84s chunked: bool = False, 84s body_pos: _TYPE_BODY_POSITION | None = None, 84s preload_content: bool = True, 84s decode_content: bool = True, 84s **response_kw: typing.Any, 84s ) -> BaseHTTPResponse: 84s """ 84s Get a connection from the pool and perform an HTTP request. This is the 84s lowest level call for making a request, so you'll need to specify all 84s the raw details. 84s 84s .. note:: 84s 84s More commonly, it's appropriate to use a convenience method 84s such as :meth:`request`. 84s 84s .. note:: 84s 84s `release_conn` will only behave as expected if 84s `preload_content=False` because we want to make 84s `preload_content=False` the default behaviour someday soon without 84s breaking backwards compatibility. 84s 84s :param method: 84s HTTP request method (such as GET, POST, PUT, etc.) 84s 84s :param url: 84s The URL to perform the request on. 84s 84s :param body: 84s Data to send in the request body, either :class:`str`, :class:`bytes`, 84s an iterable of :class:`str`/:class:`bytes`, or a file-like object. 84s 84s :param headers: 84s Dictionary of custom headers to send, such as User-Agent, 84s If-None-Match, etc. If None, pool headers are used. If provided, 84s these headers completely replace any pool-specific headers. 84s 84s :param retries: 84s Configure the number of retries to allow before raising a 84s :class:`~urllib3.exceptions.MaxRetryError` exception. 84s 84s Pass ``None`` to retry until you receive a response. Pass a 84s :class:`~urllib3.util.retry.Retry` object for fine-grained control 84s over different types of retries. 84s Pass an integer number to retry connection errors that many times, 84s but no other types of errors. Pass zero to never retry. 84s 84s If ``False``, then retries are disabled and any exception is raised 84s immediately. Also, instead of raising a MaxRetryError on redirects, 84s the redirect response will be returned. 84s 84s :type retries: :class:`~urllib3.util.retry.Retry`, False, or an int. 84s 84s :param redirect: 84s If True, automatically handle redirects (status codes 301, 302, 84s 303, 307, 308). Each redirect counts as a retry. Disabling retries 84s will disable redirect, too. 84s 84s :param assert_same_host: 84s If ``True``, will make sure that the host of the pool requests is 84s consistent else will raise HostChangedError. When ``False``, you can 84s use the pool on an HTTP proxy and request foreign hosts. 84s 84s :param timeout: 84s If specified, overrides the default timeout for this one 84s request. It may be a float (in seconds) or an instance of 84s :class:`urllib3.util.Timeout`. 84s 84s :param pool_timeout: 84s If set and the pool is set to block=True, then this method will 84s block for ``pool_timeout`` seconds and raise EmptyPoolError if no 84s connection is available within the time period. 84s 84s :param bool preload_content: 84s If True, the response's body will be preloaded into memory. 84s 84s :param bool decode_content: 84s If True, will attempt to decode the body based on the 84s 'content-encoding' header. 84s 84s :param release_conn: 84s If False, then the urlopen call will not release the connection 84s back into the pool once a response is received (but will release if 84s you read the entire contents of the response such as when 84s `preload_content=True`). This is useful if you're not preloading 84s the response's content immediately. You will need to call 84s ``r.release_conn()`` on the response ``r`` to return the connection 84s back into the pool. If None, it takes the value of ``preload_content`` 84s which defaults to ``True``. 84s 84s :param bool chunked: 84s If True, urllib3 will send the body using chunked transfer 84s encoding. Otherwise, urllib3 will send the body using the standard 84s content-length form. Defaults to False. 84s 84s :param int body_pos: 84s Position to seek to in file-like body in the event of a retry or 84s redirect. Typically this won't need to be set because urllib3 will 84s auto-populate the value when needed. 84s """ 84s parsed_url = parse_url(url) 84s destination_scheme = parsed_url.scheme 84s 84s if headers is None: 84s headers = self.headers 84s 84s if not isinstance(retries, Retry): 84s retries = Retry.from_int(retries, redirect=redirect, default=self.retries) 84s 84s if release_conn is None: 84s release_conn = preload_content 84s 84s # Check host 84s if assert_same_host and not self.is_same_host(url): 84s raise HostChangedError(self, url, retries) 84s 84s # Ensure that the URL we're connecting to is properly encoded 84s if url.startswith("/"): 84s url = to_str(_encode_target(url)) 84s else: 84s url = to_str(parsed_url.url) 84s 84s conn = None 84s 84s # Track whether `conn` needs to be released before 84s # returning/raising/recursing. Update this variable if necessary, and 84s # leave `release_conn` constant throughout the function. That way, if 84s # the function recurses, the original value of `release_conn` will be 84s # passed down into the recursive call, and its value will be respected. 84s # 84s # See issue #651 [1] for details. 84s # 84s # [1] 84s release_this_conn = release_conn 84s 84s http_tunnel_required = connection_requires_http_tunnel( 84s self.proxy, self.proxy_config, destination_scheme 84s ) 84s 84s # Merge the proxy headers. Only done when not using HTTP CONNECT. We 84s # have to copy the headers dict so we can safely change it without those 84s # changes being reflected in anyone else's copy. 84s if not http_tunnel_required: 84s headers = headers.copy() # type: ignore[attr-defined] 84s headers.update(self.proxy_headers) # type: ignore[union-attr] 84s 84s # Must keep the exception bound to a separate variable or else Python 3 84s # complains about UnboundLocalError. 84s err = None 84s 84s # Keep track of whether we cleanly exited the except block. This 84s # ensures we do proper cleanup in finally. 84s clean_exit = False 84s 84s # Rewind body position, if needed. Record current position 84s # for future rewinds in the event of a redirect/retry. 84s body_pos = set_file_position(body, body_pos) 84s 84s try: 84s # Request a connection from the queue. 84s timeout_obj = self._get_timeout(timeout) 84s conn = self._get_conn(timeout=pool_timeout) 84s 84s conn.timeout = timeout_obj.connect_timeout # type: ignore[assignment] 84s 84s # Is this a closed/new connection that requires CONNECT tunnelling? 84s if self.proxy is not None and http_tunnel_required and conn.is_closed: 84s try: 84s > self._prepare_proxy(conn) 84s 84s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:777: 84s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 84s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:1046: in _prepare_proxy 84s conn.connect() 84s /usr/lib/python3/dist-packages/urllib3/connection.py:625: in connect 84s self._tunnel() # type: ignore[attr-defined] 84s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 84s 84s self = 84s 84s def _tunnel(self): 84s connect = b"CONNECT %s:%d %s\r\n" % ( 84s self._wrap_ipv6(self._tunnel_host.encode("idna")), 84s self._tunnel_port, 84s self._http_vsn_str.encode("ascii")) 84s headers = [connect] 84s for header, value in self._tunnel_headers.items(): 84s headers.append(f"{header}: {value}\r\n".encode("latin-1")) 84s headers.append(b"\r\n") 84s # Making a single send() call instead of one per line encourages 84s # the host OS to use a more optimal packet size instead of 84s # potentially emitting a series of small packets. 84s self.send(b"".join(headers)) 84s del headers 84s 84s response = self.response_class(self.sock, method=self._method) 84s try: 84s (version, code, message) = response._read_status() 84s 84s self._raw_proxy_headers = _read_headers(response.fp) 84s 84s if self.debuglevel > 0: 84s for header in self._raw_proxy_headers: 84s print('header:', header.decode()) 84s 84s if code != http.HTTPStatus.OK: 84s self.close() 84s > raise OSError(f"Tunnel connection failed: {code} {message.strip()}") 84s E OSError: Tunnel connection failed: 403 Forbidden 84s 84s /usr/lib/python3.13/http/client.py:979: OSError 84s 84s The above exception was the direct cause of the following exception: 84s Traceback (most recent call last): 84s File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 777, in urlopen 84s self._prepare_proxy(conn) 84s ~~~~~~~~~~~~~~~~~~~^^^^^^ 84s File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1046, in _prepare_proxy 84s conn.connect() 84s ~~~~~~~~~~~~^^ 84s File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 625, in connect 84s self._tunnel() # type: ignore[attr-defined] 84s ~~~~~~~~~~~~^^ 84s File "/usr/lib/python3.13/http/client.py", line 979, in _tunnel 84s raise OSError(f"Tunnel connection failed: {code} {message.strip()}") 84s OSError: Tunnel connection failed: 403 Forbidden 84s 84s The above exception was the direct cause of the following exception: 84s 84s urllib3.exceptions.ProxyError: ('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Forbidden')) 84s 84s The above exception was the direct cause of the following exception: 84s 84s self = 84s request = , stream = False 84s timeout = Timeout(connect=None, read=None, total=None), verify = True 84s cert = None 84s proxies = OrderedDict({'no': '127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,p...,objectstorage.prodstack5.canonical.com', 'https': 'http://squid.internal:3128', 'http': 'http://squid.internal:3128'}) 84s 84s def send( 84s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 84s ): 84s """Sends PreparedRequest object. Returns Response object. 84s 84s :param request: The :class:`PreparedRequest ` being sent. 84s :param stream: (optional) Whether to stream the request content. 84s :param timeout: (optional) How long to wait for the server to send 84s data before giving up, as a float, or a :ref:`(connect timeout, 84s read timeout) ` tuple. 84s :type timeout: float or tuple or urllib3 Timeout object 84s :param verify: (optional) Either a boolean, in which case it controls whether 84s we verify the server's TLS certificate, or a string, in which case it 84s must be a path to a CA bundle to use 84s :param cert: (optional) Any user-provided SSL certificate to be trusted. 84s :param proxies: (optional) The proxies dictionary to apply to the request. 84s :rtype: requests.Response 84s """ 84s 84s try: 84s conn = self.get_connection_with_tls_context( 84s request, verify, proxies=proxies, cert=cert 84s ) 84s except LocationValueError as e: 84s raise InvalidURL(e, request=request) 84s 84s self.cert_verify(conn, request.url, verify, cert) 84s url = self.request_url(request, proxies) 84s self.add_headers( 84s request, 84s stream=stream, 84s timeout=timeout, 84s verify=verify, 84s cert=cert, 84s proxies=proxies, 84s ) 84s 84s chunked = not (request.body is None or "Content-Length" in request.headers) 84s 84s if isinstance(timeout, tuple): 84s try: 84s connect, read = timeout 84s timeout = TimeoutSauce(connect=connect, read=read) 84s except ValueError: 84s raise ValueError( 84s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 84s f"or a single float to set both timeouts to the same value." 84s ) 84s elif isinstance(timeout, TimeoutSauce): 84s pass 84s else: 84s timeout = TimeoutSauce(connect=timeout, read=timeout) 84s 84s try: 84s > resp = conn.urlopen( 84s method=request.method, 84s url=url, 84s body=request.body, 84s headers=request.headers, 84s redirect=False, 84s assert_same_host=False, 84s preload_content=False, 84s decode_content=False, 84s retries=self.max_retries, 84s timeout=timeout, 84s chunked=chunked, 84s ) 84s 84s /usr/lib/python3/dist-packages/requests/adapters.py:667: 84s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 84s /usr/lib/python3/dist-packages/urllib3/connectionpool.py:845: in urlopen 84s retries = retries.increment( 84s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 84s 84s self = Retry(total=0, connect=None, read=False, redirect=None, status=None) 84s method = 'GET', url = '/10.1038/nrd842', response = None 84s error = ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Forbidden')) 84s _pool = 84s _stacktrace = 84s 84s def increment( 84s self, 84s method: str | None = None, 84s url: str | None = None, 84s response: BaseHTTPResponse | None = None, 84s error: Exception | None = None, 84s _pool: ConnectionPool | None = None, 84s _stacktrace: TracebackType | None = None, 84s ) -> Retry: 84s """Return a new Retry object with incremented retry counters. 84s 84s :param response: A response object, or None, if the server did not 84s return a response. 84s :type response: :class:`~urllib3.response.BaseHTTPResponse` 84s :param Exception error: An error encountered during the request, or 84s None if the response was received successfully. 84s 84s :return: A new ``Retry`` object. 84s """ 84s if self.total is False and error: 84s # Disabled, indicate to re-raise the error. 84s raise reraise(type(error), error, _stacktrace) 84s 84s total = self.total 84s if total is not None: 84s total -= 1 84s 84s connect = self.connect 84s read = self.read 84s redirect = self.redirect 84s status_count = self.status 84s other = self.other 84s cause = "unknown" 84s status = None 84s redirect_location = None 84s 84s if error and self._is_connection_error(error): 84s # Connect retry? 84s if connect is False: 84s raise reraise(type(error), error, _stacktrace) 84s elif connect is not None: 84s connect -= 1 84s 84s elif error and self._is_read_error(error): 84s # Read retry? 84s if read is False or method is None or not self._is_method_retryable(method): 84s raise reraise(type(error), error, _stacktrace) 84s elif read is not None: 84s read -= 1 84s 84s elif error: 84s # Other retry? 84s if other is not None: 84s other -= 1 84s 84s elif response and response.get_redirect_location(): 84s # Redirect retry? 84s if redirect is not None: 84s redirect -= 1 84s cause = "too many redirects" 84s response_redirect_location = response.get_redirect_location() 84s if response_redirect_location: 84s redirect_location = response_redirect_location 84s status = response.status 84s 84s else: 84s # Incrementing because of a server error like a 500 in 84s # status_forcelist and the given method is in the allowed_methods 84s cause = ResponseError.GENERIC_ERROR 84s if response and response.status: 84s if status_count is not None: 84s status_count -= 1 84s cause = ResponseError.SPECIFIC_ERROR.format(status_code=response.status) 84s status = response.status 84s 84s history = self.history + ( 84s RequestHistory(method, url, error, status, redirect_location), 84s ) 84s 84s new_retry = self.new( 84s total=total, 84s connect=connect, 84s read=read, 84s redirect=redirect, 84s status=status_count, 84s other=other, 84s history=history, 84s ) 84s 84s if new_retry.is_exhausted(): 84s reason = error or ResponseError(cause) 84s > raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 84s E urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='doi.org', port=443): Max retries exceeded with url: /10.1038/nrd842 (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Forbidden'))) 84s 84s /usr/lib/python3/dist-packages/urllib3/util/retry.py:517: MaxRetryError 84s 84s During handling of the above exception, another exception occurred: 84s 84s def test_import_doi() -> None: 84s doi_good = "10.1038/nrd842" 84s > assert isinstance(import_doi(doi_good, sleep=0.00001, retries=2), str) 84s 84s /usr/lib/python3/dist-packages/duecredit/tests/test_io.py:45: 84s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 84s /usr/lib/python3/dist-packages/duecredit/io.py:62: in import_doi 84s r = requests.get(url, headers=headers) 84s /usr/lib/python3/dist-packages/requests/api.py:73: in get 84s return request("get", url, params=params, **kwargs) 84s /usr/lib/python3/dist-packages/requests/api.py:59: in request 84s return session.request(method=method, url=url, **kwargs) 84s /usr/lib/python3/dist-packages/requests/sessions.py:589: in request 84s resp = self.send(prep, **send_kwargs) 84s /usr/lib/python3/dist-packages/requests/sessions.py:703: in send 84s r = adapter.send(request, **kwargs) 84s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 84s 84s self = 84s request = , stream = False 84s timeout = Timeout(connect=None, read=None, total=None), verify = True 84s cert = None 84s proxies = OrderedDict({'no': '127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,p...,objectstorage.prodstack5.canonical.com', 'https': 'http://squid.internal:3128', 'http': 'http://squid.internal:3128'}) 84s 84s def send( 84s self, request, stream=False, timeout=None, verify=True, cert=None, proxies=None 84s ): 84s """Sends PreparedRequest object. Returns Response object. 84s 84s :param request: The :class:`PreparedRequest ` being sent. 84s :param stream: (optional) Whether to stream the request content. 84s :param timeout: (optional) How long to wait for the server to send 84s data before giving up, as a float, or a :ref:`(connect timeout, 84s read timeout) ` tuple. 84s :type timeout: float or tuple or urllib3 Timeout object 84s :param verify: (optional) Either a boolean, in which case it controls whether 84s we verify the server's TLS certificate, or a string, in which case it 84s must be a path to a CA bundle to use 84s :param cert: (optional) Any user-provided SSL certificate to be trusted. 84s :param proxies: (optional) The proxies dictionary to apply to the request. 84s :rtype: requests.Response 84s """ 84s 84s try: 84s conn = self.get_connection_with_tls_context( 84s request, verify, proxies=proxies, cert=cert 84s ) 84s except LocationValueError as e: 84s raise InvalidURL(e, request=request) 84s 84s self.cert_verify(conn, request.url, verify, cert) 84s url = self.request_url(request, proxies) 84s self.add_headers( 84s request, 84s stream=stream, 84s timeout=timeout, 84s verify=verify, 84s cert=cert, 84s proxies=proxies, 84s ) 84s 84s chunked = not (request.body is None or "Content-Length" in request.headers) 84s 84s if isinstance(timeout, tuple): 84s try: 84s connect, read = timeout 84s timeout = TimeoutSauce(connect=connect, read=read) 84s except ValueError: 84s raise ValueError( 84s f"Invalid timeout {timeout}. Pass a (connect, read) timeout tuple, " 84s f"or a single float to set both timeouts to the same value." 84s ) 84s elif isinstance(timeout, TimeoutSauce): 84s pass 84s else: 84s timeout = TimeoutSauce(connect=timeout, read=timeout) 84s 84s try: 84s resp = conn.urlopen( 84s method=request.method, 84s url=url, 84s body=request.body, 84s headers=request.headers, 84s redirect=False, 84s assert_same_host=False, 84s preload_content=False, 84s decode_content=False, 84s retries=self.max_retries, 84s timeout=timeout, 84s chunked=chunked, 84s ) 84s 84s except (ProtocolError, OSError) as err: 84s raise ConnectionError(err, request=request) 84s 84s except MaxRetryError as e: 84s if isinstance(e.reason, ConnectTimeoutError): 84s # TODO: Remove this in 3.0.0: see #2811 84s if not isinstance(e.reason, NewConnectionError): 84s raise ConnectTimeout(e, request=request) 84s 84s if isinstance(e.reason, ResponseError): 84s raise RetryError(e, request=request) 84s 84s if isinstance(e.reason, _ProxyError): 84s > raise ProxyError(e, request=request) 84s E requests.exceptions.ProxyError: HTTPSConnectionPool(host='doi.org', port=443): Max retries exceeded with url: /10.1038/nrd842 (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Forbidden'))) 84s 84s /usr/lib/python3/dist-packages/requests/adapters.py:694: ProxyError 84s =============================== warnings summary =============================== 84s ../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475 84s /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475: PytestCacheWarning: could not create cache path /usr/lib/python3/dist-packages/duecredit/tests/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/duecredit/tests/pytest-cache-files-o67wpy3p' 84s config.cache.set("cache/nodeids", sorted(self.cached_nodeids)) 84s 84s ../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429 84s /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429: PytestCacheWarning: could not create cache path /usr/lib/python3/dist-packages/duecredit/tests/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/duecredit/tests/pytest-cache-files-0rajte6_' 84s config.cache.set("cache/lastfailed", self.lastfailed) 84s 84s ../../../../usr/lib/python3/dist-packages/_pytest/stepwise.py:51 84s /usr/lib/python3/dist-packages/_pytest/stepwise.py:51: PytestCacheWarning: could not create cache path /usr/lib/python3/dist-packages/duecredit/tests/.pytest_cache/v/cache/stepwise: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/duecredit/tests/pytest-cache-files-b45qvhu5' 84s session.config.cache.set(STEPWISE_CACHE_DIR, []) 84s 84s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html 84s =========================== short test summary info ============================ 84s FAILED ../../../../usr/lib/python3/dist-packages/duecredit/tests/test_io.py::test_import_doi 84s ================= 1 failed, 75 deselected, 3 warnings in 0.78s ================= 84s autopkgtest [08:22:37]: test command2: -----------------------] 85s command2 FAIL non-zero exit status 1 85s autopkgtest [08:22:38]: test command2: - - - - - - - - - - results - - - - - - - - - - 85s autopkgtest [08:22:38]: @@@@@@@@@@@@@@@@@@@@ summary 85s command1 FAIL non-zero exit status 1 85s command2 FAIL non-zero exit status 1 89s nova [W] Skipping flock for amd64 89s Creating nova instance adt-plucky-amd64-duecredit-20241113-082113-juju-7f2275-prod-proposed-migration-environment-15-d96ba319-01c8-4a7a-bd5b-03d5340f4d2c from image adt/ubuntu-plucky-amd64-server-20241113.img (UUID 62c21ac4-2290-4c8d-8313-dddd18eacff4)...