Source: distro-info
Version: 1.7
Severity: serious
Justification: FTBFS
Tags: trixie sid ftbfs
User: lu...@debian.org
Usertags: ftbfs-20240420 ftbfs-trixie ftbfs-t64-arm64

Hi,

During a rebuild of all packages in sid, your package failed to build
on arm64.


Relevant part (hopefully):
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> ./test-debian-distro-info
> cd perl && ./test.pl
> testAlias
> testAll
> testDevel
> py3versions: no X-Python3-Version in control file, using supported versions
> cd python && python3.12 setup.py test
> 1..35
> testOldstable
> ok 1 - unique: Matching lists
> ok 2 - symmetric_difference: Matching lists
> ok 3 - unique: 1 Unique Item
> ok 4 - unique: 1 Unique Item in the haystack
> ok 5 - symmetric_difference: 1 Unique Item
> ok 6 - Debian all
> ok 7 - Debian devel
> ok 8 - Debian oldstable
> ok 9 - Debian stable
> ok 10 - Debian testing
> ok 11 - Debian valid
> ok 12 - Debian valid
> ok 13 - Debian invalid
> ok 14 - Debian supported
> ok 15 - Debian LTS
> ok 16 - Debian ELTS
> ok 17 - Debian unsupported
> ok 18 - Debian codename, invalid
> ok 19 - Debian codename
> ok 20 - Debian version, invalid
> ok 21 - Debian version
> ok 22 - Ubuntu all
> ok 23 - Ubuntu version
> ok 24 - Ubuntu LTS version
> ok 25 - Ubuntu devel
> ok 26 - Ubuntu LTS
> ok 27 - Ubuntu stable
> ok 28 - Ubuntu valid
> ok 29 - Ubuntu invalid
> ok 30 - Ubuntu is_lts
> ok 31 - Ubuntu !is_lts
> ok 32 - Ubuntu !is_lts
> ok 33 - Ubuntu supported
> ok 34 - Ubuntu ESM
> ok 35 - Ubuntu unsupported
> testStable
> testSupported
> testLTS
> testELTS
> testUnsupported
> testTesting
> testFullname
> running test
> WARNING: Testing via this command is deprecated and will be removed in a 
> future version. Users looking for a generic test entry point independent of 
> test runner are encouraged to use tox.
> /usr/lib/python3/dist-packages/setuptools/command/test.py:193: 
> _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are 
> deprecated.
> !!
> 
>         
> ********************************************************************************
>         Requirements should be satisfied by a PEP 517 installer.
>         If you are using pip, you can try `pip install --use-pep517`.
>         
> ********************************************************************************
> 
> !!
>   ir_d = dist.fetch_build_eggs(dist.install_requires)
> WARNING: The wheel package is not available.
> testRelease
> /usr/lib/python3/dist-packages/setuptools/command/test.py:194: 
> _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are 
> deprecated.
> !!
> 
>         
> ********************************************************************************
>         Requirements should be satisfied by a PEP 517 installer.
>         If you are using pip, you can try `pip install --use-pep517`.
>         
> ********************************************************************************
> 
> !!
>   tr_d = dist.fetch_build_eggs(dist.tests_require or [])
> WARNING: The wheel package is not available.
> /usr/lib/python3/dist-packages/setuptools/command/test.py:195: 
> _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are 
> deprecated.
> !!
> 
>         
> ********************************************************************************
>         Requirements should be satisfied by a PEP 517 installer.
>         If you are using pip, you can try `pip install --use-pep517`.
>         
> ********************************************************************************
> 
> !!
>   er_d = dist.fetch_build_eggs(
> WARNING: The wheel package is not available.
> running egg_info
> testSeries
> creating distro_info.egg-info
> writing distro_info.egg-info/PKG-INFO
> writing dependency_links to distro_info.egg-info/dependency_links.txt
> writing top-level names to distro_info.egg-info/top_level.txt
> writing manifest file 'distro_info.egg-info/SOURCES.txt'
> testCombinedShortform
> testReleaseDate
> reading manifest file 'distro_info.egg-info/SOURCES.txt'
> writing manifest file 'distro_info.egg-info/SOURCES.txt'
> running build_ext
> test_make_pep440_compliant_debian_backport 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_debian_backport)
> Test make_pep440_compliant() with Debian backport version. ... ok
> test_make_pep440_compliant_debian_stable 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_debian_stable)
> Test make_pep440_compliant() with Debian stable update. ... ok
> test_make_pep440_compliant_debian_stable_backport 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_debian_stable_backport)
> Test make_pep440_compliant() with Debian stable backport. ... ok
> test_make_pep440_compliant_tilde 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_tilde)
> Test make_pep440_compliant() with tilde in Debian version. ... ok
> test_make_pep440_compliant_ubuntu 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_ubuntu)
> Test make_pep440_compliant() with Ubuntu version. ... ok
> test_make_pep440_compliant_ubuntu_backport 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_ubuntu_backport)
> Test make_pep440_compliant() with Ubuntu backport version. ... ok
> test_make_pep440_compliant_ubuntu_security 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_ubuntu_security)
> Test make_pep440_compliant() with Ubuntu security update. ... ok
> test_make_pep440_compliant_unchanged 
> (distro_info_test.test_setup.SetupTestCase.test_make_pep440_compliant_unchanged)
> Test make_pep440_compliant() with already correct version. ... ok
> test_pylint (distro_info_test.test_pylint.PylintTestCase.test_pylint)
> Test: Run pylint on Python source code. ... Running following command:
> pylint --rcfile=/<<PKGBUILDDIR>>/python/distro_info_test/pylint.conf 
> debian-distro-info ubuntu-distro-info distro_info_test distro_info.py setup.py
> testHelp
> testExactlyOne
> testUnrecognizedOption
> testUnrecognizedArguments
> testMissingArgumentAlias
> testMissingArgumentDate
> testMissingArgumentSeries
> testInvalidAlias
> testInvalidDate
> testInvalidSeries
> testMultipleAlias
> testMultipleDates
> testMultipleSeries
> testUnknownSeries
> testSourceDateEpoch
> testDays
> 
> Ran 31 tests.
> 
> OK
> ./test-ubuntu-distro-info
> testAll
> testDevel
> testLatest
> testLTS
> testStable
> testSupported
> testUnsupported
> testFullname
> testRelease
> testSeries
> testCombinedShortform
> testReleaseDate
> testHelp
> testExactlyOne
> testUnrecognizedOption
> testUnrecognizedArguments
> testMissingArgumentDate
> testMissingArgumentSeries
> testDistributionDataOutdated
> testInvalidDate
> testInvalidSeries
> testMultipleDates
> testMultipleSeries
> testUnknownSeries
> testSourceDateEpoch
> testDays
> 
> Ran 26 tests.
> 
> OK
> FAIL
> test_all (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_all)
> Test: List all known Debian distributions. ... ok
> test_codename 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_codename)
> Test: Codename decoding ... ok
> test_codename_result 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_codename_result)
> Test: Check result set to codename. ... ok
> test_devel 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_devel)
> Test: Get latest development Debian distribution. ... ok
> test_elts_supported 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_elts_supported)
> Test: List all ELTS supported Debian distribution. ... ok
> test_fullname 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_fullname)
> Test: Check result set to fullname. ... ok
> test_lts_supported 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_lts_supported)
> Test: List all LTS supported Debian distribution. ... ok
> test_old (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_old)
> Test: Get old (stable) Debian distribution. ... ok
> test_release 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_release)
> Test: Check result set to release. ... ok
> test_stable 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_stable)
> Test: Get latest stable Debian distribution. ... ok
> test_supported 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_supported)
> Test: List all supported Debian distribution. ... ok
> test_testing 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_testing)
> Test: Get latest testing Debian distribution. ... ok
> test_unsupported 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_unsupported)
> Test: List all unsupported Debian distribution. ... ok
> test_valid 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_valid)
> Test: Check for valid Debian distribution. ... ok
> test_version 
> (distro_info_test.test_distro_info.DebianDistroInfoTestCase.test_version)
> Test: Version decoding ... ok
> test_all (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_all)
> Test: List all known Ubuntu distributions. ... ok
> test_codename 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_codename)
> Test: Check result set to codename. ... ok
> test_current_unsupported 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_current_unsupported)
> Test: List all unsupported Ubuntu distributions today. ... ok
> test_devel 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_devel)
> Test: Get latest development Ubuntu distribution. ... ok
> test_fullname 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_fullname)
> Test: Check result set to fullname. ... ok
> test_is_lts 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_is_lts)
> Test: Check if Ubuntu distribution is an LTS. ... ok
> test_lts (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_lts)
> Test: Get latest long term support (LTS) Ubuntu distribution. ... ok
> test_release 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_release)
> Test: Check result set to release. ... ok
> test_stable 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_stable)
> Test: Get latest stable Ubuntu distribution. ... ok
> test_supported 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_supported)
> Test: List all supported Ubuntu distribution. ... ok
> test_unsupported 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_unsupported)
> Test: List all unsupported Ubuntu distributions. ... ok
> test_valid 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_valid)
> Test: Check for valid Ubuntu distribution. ... ok
> test_version 
> (distro_info_test.test_distro_info.UbuntuDistroInfoTestCase.test_version)
> Test: Check result set to version. ... ok
> test_isort (distro_info_test.test_isort.IsortTestCase.test_isort)
> Test: Run isort on Python source code. ... Running following command:
> isort --check-only --diff -l 99 debian-distro-info ubuntu-distro-info 
> distro_info_test distro_info.py setup.py
> ok
> test_black (distro_info_test.test_black.BlackTestCase.test_black)
> Test: Run black code formatter on Python source code. ... Running following 
> command:
> black --check --diff -l 99 debian-distro-info ubuntu-distro-info 
> distro_info_test distro_info.py setup.py
> ok
> test_mypy (distro_info_test.test_mypy.MypyTestCase.test_mypy)
> Test: Run mypy on Python source code. ... Running following command:
> mypy --ignore-missing-imports --strict distro_info_test distro_info.py 
> setup.py
> ok
> test_flake8 (distro_info_test.test_flake8.Flake8TestCase.test_flake8)
> Test: Run flake8 on Python source code. ... Running following command:
> /usr/bin/python3.12 -m flake8 --max-line-length=99 debian-distro-info 
> ubuntu-distro-info distro_info_test distro_info.py setup.py
> ok
> 
> ======================================================================
> FAIL: test_pylint (distro_info_test.test_pylint.PylintTestCase.test_pylint)
> Test: Run pylint on Python source code.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/<<PKGBUILDDIR>>/python/distro_info_test/test_pylint.py", line 70, in 
> test_pylint
>     self.fail("\n".join(msgs))
> AssertionError: pylint exited with code 17 and has unexpected output on 
> stderr:
> Exception on node <Name.__name__ l.135 at 0xffffbd161990> in file 
> '/<<PKGBUILDDIR>>/python/debian-distro-info'
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 91, 
> in walk
>     callback(astroid)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 1642, in visit_name
>     self._loopvar_name(node)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 2550, in _loopvar_name
>     if astmts[i].statement().parent_of(stmt) and not utils.in_for_else_branch(
>        ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/astroid/nodes/node_ng.py", line 297, 
> in statement
>     return self.parent.statement()
>            ^^^^^^^^^^^^^^^^^^^^^^^
>   File 
> "/usr/lib/python3/dist-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", 
> line 414, in statement
>     raise StatementMissing(target=self)
> astroid.exceptions.StatementMissing: Statement not found on 
> <Module.debian-distro-info l.0 at 0xffffbd2e6e90>
> Can't write the issue template for the crash in 
> /<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-24.txt
>  because of: '[Errno 2] No such file or directory: 
> '/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-24.txt''
> Here's the content anyway:
> First, please verify that the bug is not already filled:
> https://github.com/pylint-dev/pylint/issues/
> 
> Then create a new issue:
> https://github.com/pylint-dev/pylint/issues/new?labels=Crash 💥%2CNeeds triage 
> 📥
> 
> 
> 
> Issue title:
> Crash ```` (if possible, be more specific about what made pylint crash)
> 
> ### Bug description
> 
> When parsing the following ``a.py``:
> 
> <!--
>  If sharing the code is not an option, please state so,
>  but providing only the stacktrace would still be helpful.
>  -->
> 
> ```python
> #!/usr/bin/python3
> 
> # Copyright (C) 2009-2011, Benjamin Drung <bdr...@debian.org>
> #
> # Permission to use, copy, modify, and/or distribute this software for any
> # purpose with or without fee is hereby granted, provided that the above
> # copyright notice and this permission notice appear in all copies.
> #
> # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> 
> # pylint: disable=invalid-name
> # pylint: enable=invalid-name
> 
> """provides information about Debian's distributions"""
> 
> import argparse
> import os
> import sys
> 
> from distro_info import DebianDistroInfo, convert_date
> 
> 
> def parse_args():
>     script_name = os.path.basename(sys.argv[0])
>     usage = f"{script_name} [options]"
>     epilog = f"See {script_name}(1) for more info."
>     parser = argparse.ArgumentParser(usage=usage, epilog=epilog)
> 
>     parser.add_argument(
>         "--date",
>         dest="date",
>         default=None,
>         help="date for calculating the version (default: today).",
>     )
>     parser.add_argument(
>         "-a", "--all", dest="all", action="store_true", help="list all known 
> versions"
>     )
>     parser.add_argument(
>         "-d", "--devel", dest="devel", action="store_true", help="latest 
> development version"
>     )
>     parser.add_argument(
>         "-t", "--testing", dest="testing", action="store_true", help="current 
> testing version"
>     )
>     parser.add_argument(
>         "-s", "--stable", dest="stable", action="store_true", help="latest 
> stable version"
>     )
>     parser.add_argument(
>         "-o", "--old", dest="old", action="store_true", help="latest old 
> (stable) version"
>     )
>     parser.add_argument(
>         "--supported",
>         dest="supported",
>         action="store_true",
>         help="list of all supported versions (including development)",
>     )
>     parser.add_argument(
>         "-l",
>         "--lts",
>         dest="lts",
>         action="store_true",
>         help="list of all LTS supported stable versions",
>     )
>     parser.add_argument(
>         "-e",
>         "--elts",
>         dest="elts",
>         action="store_true",
>         help="list of all ELTS supported stable versions",
>     )
>     parser.add_argument(
>         "--unsupported", dest="unsupported", help="list of all unsupported 
> stable versions"
>     )
> 
>     args = parser.parse_args()
> 
>     versions = [
>         args.all,
>         args.devel,
>         args.lts,
>         args.elts,
>         args.old,
>         args.stable,
>         args.supported,
>         args.testing,
>         args.unsupported,
>     ]
>     if len([x for x in versions if x]) != 1:
>         parser.error(
>             "You have to select exactly one of --all, --devel, --elts, --lts,"
>             " --old, --stable, --supported, --testing, --unsupported."
>         )
> 
>     if args.date is not None:
>         try:
>             args.date = convert_date(args.date)
>         except ValueError:
>             parser.error("Option --date needs to be a date in ISO 8601 
> format.")
>     return args
> 
> 
> def main():
>     # pylint: disable=too-many-branches
>     args = parse_args()
>     if args.all:
>         for distro in DebianDistroInfo().all:
>             sys.stdout.write(distro + "\n")
>     elif args.devel:
>         sys.stdout.write(DebianDistroInfo().devel(args.date) + "\n")
>     elif args.old:
>         sys.stdout.write(DebianDistroInfo().old(args.date) + "\n")
>     elif args.stable:
>         sys.stdout.write(DebianDistroInfo().stable(args.date) + "\n")
>     elif args.supported:
>         for distro in DebianDistroInfo().supported(args.date):
>             sys.stdout.write(distro + "\n")
>     elif args.lts:
>         for distro in DebianDistroInfo().lts_supported(args.date):
>             sys.stdout.write(distro + "\n")
>     elif args.elts:
>         for distro in DebianDistroInfo().elts_supported(args.date):
>             sys.stdout.write(distro + "\n")
>     elif args.testing:
>         sys.stdout.write(DebianDistroInfo().testing(args.date) + "\n")
>     elif args.unsupported:
>         for distro in DebianDistroInfo().unsupported(args.date):
>             sys.stdout.write(distro + "\n")
> 
> 
> if __name__ == "__main__":
>     main()
> 
> ```
> 
> ### Command used
> 
> ```shell
> pylint a.py
> ```
> 
> ### Pylint output
> 
> <details open>
>     <summary>
>         pylint crashed with a ``AstroidError`` and with the following 
> stacktrace:
>     </summary>
> 
> ```python
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 788, in 
> _lint_file
>     check_astroid_module(module)
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1017, 
> in check_astroid_module
>     retval = self._check_astroid_module(
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1069, 
> in _check_astroid_module
>     walker.walk(node)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 91, 
> in walk
>     callback(astroid)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 1642, in visit_name
>     self._loopvar_name(node)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 2550, in _loopvar_name
>     if astmts[i].statement().parent_of(stmt) and not utils.in_for_else_branch(
>        ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/astroid/nodes/node_ng.py", line 297, 
> in statement
>     return self.parent.statement()
>            ^^^^^^^^^^^^^^^^^^^^^^^
>   File 
> "/usr/lib/python3/dist-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", 
> line 414, in statement
>     raise StatementMissing(target=self)
> astroid.exceptions.StatementMissing: Statement not found on 
> <Module.debian-distro-info l.0 at 0xffffbd2e6e90>
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 752, in 
> _lint_files
>     self._lint_file(fileitem, module, check_astroid_module)
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 790, in 
> _lint_file
>     raise astroid.AstroidError from e
> astroid.exceptions.AstroidError
> 
> ```
> 
> 
> </details>
> 
> ### Expected behavior
> 
> No crash.
> 
> ### Pylint version
> 
> ```shell
> pylint 3.0.3
> astroid 3.1.0
> Python 3.11.9 (main, Apr 10 2024, 13:16:36) [GCC 13.2.0]
> ```
> 
> ### OS / Environment
> 
> linux (Linux)
> 
> ### Additional dependencies
> 
> <!--
> Please remove this part if you're not using any of
> your dependencies in the example.
>  -->
> .
> Can't write the issue template for the crash in 
> /<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-24.txt
>  because of: '[Errno 2] No such file or directory: 
> '/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-24.txt''
> Here's the content anyway:
> First, please verify that the bug is not already filled:
> https://github.com/pylint-dev/pylint/issues/
> 
> Then create a new issue:
> https://github.com/pylint-dev/pylint/issues/new?labels=Crash 💥%2CNeeds triage 
> 📥
> 
> 
> 
> Issue title:
> Crash ```` (if possible, be more specific about what made pylint crash)
> 
> ### Bug description
> 
> When parsing the following ``a.py``:
> 
> <!--
>  If sharing the code is not an option, please state so,
>  but providing only the stacktrace would still be helpful.
>  -->
> 
> ```python
> #!/usr/bin/python3
> 
> # Copyright (C) 2009-2011, Benjamin Drung <bdr...@debian.org>
> #
> # Permission to use, copy, modify, and/or distribute this software for any
> # purpose with or without fee is hereby granted, provided that the above
> # copyright notice and this permission notice appear in all copies.
> #
> # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
> # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
> # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
> # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
> # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
> # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> 
> # pylint: disable=invalid-name
> # pylint: enable=invalid-name
> 
> """provides information about Ubuntu's distributions"""
> 
> import argparse
> import os
> import sys
> 
> from distro_info import UbuntuDistroInfo, convert_date
> 
> 
> def parse_args() -> argparse.Namespace:
>     script_name = os.path.basename(sys.argv[0])
>     usage = f"{script_name} [options]"
>     epilog = f"See {script_name}(1) for more info."
>     parser = argparse.ArgumentParser(usage=usage, epilog=epilog)
> 
>     parser.add_argument(
>         "--date",
>         dest="date",
>         default=None,
>         help="date for calculating the version (default: today).",
>     )
>     parser.add_argument(
>         "-a", "--all", dest="all", action="store_true", help="list all known 
> versions"
>     )
>     parser.add_argument(
>         "-d", "--devel", dest="devel", action="store_true", help="latest 
> development version"
>     )
>     parser.add_argument(
>         "-s", "--stable", dest="stable", action="store_true", help="latest 
> stable version"
>     )
>     parser.add_argument(
>         "--lts", dest="lts", action="store_true", help="latest long term 
> support (LTS) version"
>     )
>     parser.add_argument(
>         "--supported",
>         dest="supported",
>         action="store_true",
>         help="list of all supported versions (including development)",
>     )
>     parser.add_argument(
>         "--unsupported",
>         dest="unsupported",
>         action="store_true",
>         help="list of all unsupported stable versions",
>     )
> 
>     args = parser.parse_args()
> 
>     versions = [args.all, args.devel, args.lts, args.stable, args.supported, 
> args.unsupported]
>     if len([x for x in versions if x]) != 1:
>         parser.error(
>             "You have to select exactly one of --all, --devel, --lts, "
>             "--stable, --supported, --unsupported."
>         )
> 
>     if args.date is not None:
>         try:
>             args.date = convert_date(args.date)
>         except ValueError:
>             parser.error("Option --date needs to be a date in ISO 8601 
> format.")
> 
>     return args
> 
> 
> def main() -> None:
>     args = parse_args()
>     if args.all:
>         for distro in UbuntuDistroInfo().all:
>             sys.stdout.write(distro + "\n")
>     elif args.devel:
>         sys.stdout.write(UbuntuDistroInfo().devel(args.date) + "\n")
>     elif args.lts:
>         sys.stdout.write(UbuntuDistroInfo().lts(args.date) + "\n")
>     elif args.stable:
>         sys.stdout.write(UbuntuDistroInfo().stable(args.date) + "\n")
>     elif args.supported:
>         for distro in UbuntuDistroInfo().supported(args.date):
>             sys.stdout.write(distro + "\n")
>     elif args.unsupported:
>         for distro in UbuntuDistroInfo().unsupported(args.date):
>             sys.stdout.write(distro + "\n")
> 
> 
> if __name__ == "__main__":
>     main()
> 
> ```
> 
> ### Command used
> 
> ```shell
> pylint a.py
> ```
> 
> ### Pylint output
> 
> <details open>
>     <summary>
>         pylint crashed with a ``AstroidError`` and with the following 
> stacktrace:
>     </summary>
> 
> ```python
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 788, in 
> _lint_file
>     check_astroid_module(module)
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1017, 
> in check_astroid_module
>     retval = self._check_astroid_module(
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1069, 
> in _check_astroid_module
>     walker.walk(node)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 91, 
> in walk
>     callback(astroid)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 1642, in visit_name
>     self._loopvar_name(node)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 2550, in _loopvar_name
>     if astmts[i].statement().parent_of(stmt) and not utils.in_for_else_branch(
>        ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/astroid/nodes/node_ng.py", line 297, 
> in statement
>     return self.parent.statement()
>            ^^^^^^^^^^^^^^^^^^^^^^^
>   File 
> "/usr/lib/python3/dist-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", 
> line 414, in statement
>     raise StatementMissing(target=self)
> astroid.exceptions.StatementMissing: Statement not found on 
> <Module.ubuntu-distro-info l.0 at 0xffffbd162ad0>
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 752, in 
> _lint_files
>     self._lint_file(fileitem, module, check_astroid_module)
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 790, in 
> _lint_file
>     raise astroid.AstroidError from e
> astroid.exceptions.AstroidError
> 
> ```
> 
> 
> </details>
> 
> ### Expected behavior
> 
> No crash.
> 
> ### Pylint version
> 
> ```shell
> pylint 3.0.3
> astroid 3.1.0
> Python 3.11.9 (main, Apr 10 2024, 13:16:36) [GCC 13.2.0]
> ```
> 
> ### OS / Environment
> 
> linux (Linux)
> 
> ### Additional dependencies
> 
> <!--
> Please remove this part if you're not using any of
> your dependencies in the example.
>  -->
> .
> Can't write the issue template for the crash in 
> /<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-27.txt
>  because of: '[Errno 2] No such file or directory: 
> '/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-27.txt''
> Here's the content anyway:
> First, please verify that the bug is not already filled:
> https://github.com/pylint-dev/pylint/issues/
> 
> Then create a new issue:
> https://github.com/pylint-dev/pylint/issues/new?labels=Crash 💥%2CNeeds triage 
> 📥
> 
> 
> 
> Issue title:
> Crash ```` (if possible, be more specific about what made pylint crash)
> 
> ### Bug description
> 
> When parsing the following ``a.py``:
> 
> <!--
>  If sharing the code is not an option, please state so,
>  but providing only the stacktrace would still be helpful.
>  -->
> 
> ```python
> #!/usr/bin/python3
> 
> import pathlib
> import re
> 
> from setuptools import setup
> 
> PACKAGES = ["distro_info"]
> PY_MODULES = ["distro_info"]
> SCRIPTS = ["debian-distro-info", "ubuntu-distro-info"]
> 
> 
> def get_debian_version() -> str:
>     """look what Debian version we have"""
>     changelog = pathlib.Path(__file__).parent.parent / "debian" / "changelog"
>     with changelog.open("r", encoding="utf-8") as changelog_f:
>         head = changelog_f.readline()
>     match = re.compile(r".*\((.*)\).*").match(head)
>     if not match:
>         raise ValueError(f"Failed to extract Debian version from '{head}'.")
>     return match.group(1)
> 
> 
> def make_pep440_compliant(version: str) -> str:
>     """Convert the version into a PEP440 compliant version."""
>     public_version_re = 
> re.compile(r"^([0-9][0-9.]*(?:(?:a|b|rc|.post|.dev)[0-9]+)*)\+?")
>     _, public, local = public_version_re.split(version, maxsplit=1)
>     if not local:
>         return version
>     sanitized_local = re.sub("[+~]+", ".", local).strip(".")
>     pep440_version = f"{public}+{sanitized_local}"
>     assert re.match("^[a-zA-Z0-9.]+$", sanitized_local), f"'{pep440_version}' 
> not PEP440 compliant"
>     return pep440_version
> 
> 
> if __name__ == "__main__":
>     setup(
>         name="distro-info",
>         version=make_pep440_compliant(get_debian_version()),
>         py_modules=PY_MODULES,
>         packages=PACKAGES,
>         test_suite="distro_info_test",
>         url="https://salsa.debian.org/debian/distro-info";,
>         author="Benjamin Drung",
>         author_email="bdr...@debian.org",
>         package_data={"distro_info": ["py.typed"]},
>     )
> 
> ```
> 
> ### Command used
> 
> ```shell
> pylint a.py
> ```
> 
> ### Pylint output
> 
> <details open>
>     <summary>
>         pylint crashed with a ``AstroidError`` and with the following 
> stacktrace:
>     </summary>
> 
> ```python
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 788, in 
> _lint_file
>     check_astroid_module(module)
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1017, 
> in check_astroid_module
>     retval = self._check_astroid_module(
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 1069, 
> in _check_astroid_module
>     walker.walk(node)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 94, 
> in walk
>     self.walk(child)
>   File "/usr/lib/python3/dist-packages/pylint/utils/ast_walker.py", line 91, 
> in walk
>     callback(astroid)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 1642, in visit_name
>     self._loopvar_name(node)
>   File "/usr/lib/python3/dist-packages/pylint/checkers/variables.py", line 
> 2550, in _loopvar_name
>     if astmts[i].statement().parent_of(stmt) and not utils.in_for_else_branch(
>        ^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib/python3/dist-packages/astroid/nodes/node_ng.py", line 297, 
> in statement
>     return self.parent.statement()
>            ^^^^^^^^^^^^^^^^^^^^^^^
>   File 
> "/usr/lib/python3/dist-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", 
> line 414, in statement
>     raise StatementMissing(target=self)
> astroid.exceptions.StatementMissing: Statement not found on <Module.setup l.0 
> at 0xffffbc67a5d0>
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 752, in 
> _lint_files
>     self._lint_file(fileitem, module, check_astroid_module)
>   File "/usr/lib/python3/dist-packages/pylint/lint/pylinter.py", line 790, in 
> _lint_file
>     raise astroid.AstroidError from e
> astroid.exceptions.AstroidError
> 
> ```
> 
> 
> </details>
> 
> ### Expected behavior
> 
> No crash.
> 
> ### Pylint version
> 
> ```shell
> pylint 3.0.3
> astroid 3.1.0
> Python 3.11.9 (main, Apr 10 2024, 13:16:36) [GCC 13.2.0]
> ```
> 
> ### OS / Environment
> 
> linux (Linux)
> 
> ### Additional dependencies
> 
> <!--
> Please remove this part if you're not using any of
> your dependencies in the example.
>  -->
> .
> pylint found issues:
> ************* Module debian-distro-info
> debian-distro-info:1:0: F0002: debian-distro-info: Fatal error while checking 
> 'debian-distro-info'. Please open an issue in our bug tracker so we address 
> this. There is a pre-filled template that you can use in 
> '/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-24.txt'.
>  (astroid-error)
> ************* Module ubuntu-distro-info
> ubuntu-distro-info:22:0: C0413: Import "import argparse" should be placed at 
> the top of the module (wrong-import-position)
> ubuntu-distro-info:23:0: C0413: Import "import os" should be placed at the 
> top of the module (wrong-import-position)
> ubuntu-distro-info:24:0: C0413: Import "import sys" should be placed at the 
> top of the module (wrong-import-position)
> ubuntu-distro-info:26:0: C0413: Import "from distro_info import 
> UbuntuDistroInfo, convert_date" should be placed at the top of the module 
> (wrong-import-position)
> ubuntu-distro-info:1:0: F0002: ubuntu-distro-info: Fatal error while checking 
> 'ubuntu-distro-info'. Please open an issue in our bug tracker so we address 
> this. There is a pre-filled template that you can use in 
> '/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-24.txt'.
>  (astroid-error)
> ************* Module distro_info_test
> distro_info_test/__init__.py:17:0: C0413: Import "import inspect" should be 
> placed at the top of the module (wrong-import-position)
> distro_info_test/__init__.py:18:0: C0413: Import "import os" should be placed 
> at the top of the module (wrong-import-position)
> distro_info_test/__init__.py:19:0: C0413: Import "import unittest" should be 
> placed at the top of the module (wrong-import-position)
> ubuntu-distro-info:22:0: C0411: standard import "import argparse" should be 
> placed before "from distro_info import DebianDistroInfo, convert_date" 
> (wrong-import-order)
> ubuntu-distro-info:23:0: C0411: standard import "import os" should be placed 
> before "from distro_info import DebianDistroInfo, convert_date" 
> (wrong-import-order)
> ubuntu-distro-info:24:0: C0411: standard import "import sys" should be placed 
> before "from distro_info import DebianDistroInfo, convert_date" 
> (wrong-import-order)
> distro_info_test/__init__.py:17:0: C0411: standard import "import inspect" 
> should be placed before "from distro_info import DebianDistroInfo, 
> convert_date" (wrong-import-order)
> distro_info_test/__init__.py:18:0: C0411: standard import "import os" should 
> be placed before "from distro_info import DebianDistroInfo, convert_date" 
> (wrong-import-order)
> distro_info_test/__init__.py:19:0: C0411: standard import "import unittest" 
> should be placed before "from distro_info import DebianDistroInfo, 
> convert_date" (wrong-import-order)
> ubuntu-distro-info:22:0: C0412: Imports from package argparse are not grouped 
> (ungrouped-imports)
> ubuntu-distro-info:23:0: C0412: Imports from package os are not grouped 
> (ungrouped-imports)
> ubuntu-distro-info:24:0: C0412: Imports from package sys are not grouped 
> (ungrouped-imports)
> distro_info_test/__init__.py:18:0: C0412: Imports from package os are not 
> grouped (ungrouped-imports)
> ************* Module setup
> setup.py:1:0: F0002: setup.py: Fatal error while checking 'setup.py'. Please 
> open an issue in our bug tracker so we address this. There is a pre-filled 
> template that you can use in 
> '/<<PKGBUILDDIR>>/debian/.debhelper/generated/_source/home/.cache/pylint/pylint-crash-2024-04-20-04-31-27.txt'.
>  (astroid-error)
> 
> ----------------------------------------------------------------------
> Ran 41 tests in 9.078s
> 
> FAILED (failures=1)
> Test failed: <unittest.runner.TextTestResult run=41 errors=0 failures=1>
> error: Test failed: <unittest.runner.TextTestResult run=41 errors=0 
> failures=1>
> make[1]: *** [Makefile:39: test-python] Error 1
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> dh_auto_test: error: make -j4 test returned exit code 2


The full build log is available from:
http://qa-logs.debian.net/2024/04/20/distro-info_1.7_unstable-arm64.log

All bugs filed during this archive rebuild are listed at:
https://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=ftbfs-20240420;users=lu...@debian.org
or:
https://udd.debian.org/bugs/?release=na&merged=ign&fnewerval=7&flastmodval=7&fusertag=only&fusertagtag=ftbfs-20240420&fusertaguser=lu...@debian.org&allbugs=1&cseverity=1&ctags=1&caffected=1#results

A list of current common problems and possible solutions is available at
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

If you reassign this bug to another package, please mark it as 'affects'-ing
this package. See https://www.debian.org/Bugs/server-control#affects

If you fail to reproduce this, please provide a build log and diff it with mine
so that we can identify if something relevant changed in the meantime.

Reply via email to