#1057547 cclib-data: FTBFS: failing tests

#1057547#5
Date:
2023-12-05 22:04:07 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:
--------------------------------------------------------------------------------
[...]
  debian/rules binary
dh binary --with python3 --buildsystem pybuild
    dh_update_autotools_config -O--buildsystem=pybuild
    dh_autoreconf -O--buildsystem=pybuild
    dh_auto_configure -O--buildsystem=pybuild
I: pybuild base:310: python3.11 setup.py config
Warning: 'classifiers' should be a list, got type 'filter'
    dh_auto_build -O--buildsystem=pybuild
I: pybuild base:310: /usr/bin/python3 setup.py build
Warning: 'classifiers' should be a list, got type 'filter'
    dh_auto_test -O--buildsystem=pybuild
I: pybuild base:310: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11/build; python3.11 -m pytest test
============================= test session starts ==============================
platform linux -- Python 3.11.7, pytest-7.4.3, pluggy-1.3.0

[... snipped ...]

             )

         elif extension in ['.bz', '.bz2']:
             # Module 'bz2' is not always importable.
             assert bz2 is not None, "ERROR: module bz2 cannot be imported"
             fileobject = io.TextIOWrapper(bz2.BZ2File(fileobject if fileobject else filename, mode), encoding = encoding, errors = errors)

         elif fileobject is not None:
             # Assuming that object is text file encoded in utf-8
             # If the file/stream has already been opened, we have no ability to handle decoding errors.
             pass

         else:
             # Normal text file.
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:210: FileNotFoundError

test/parser/testspecificparsers.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/cclib/parser/gamessukparser.py:24: in __init__
     super().__init__(logname="GAMESSUK", *args, **kwargs)
/usr/lib/python3/dist-packages/cclib/parser/logfileparser.py:56: in __init__
     source = FileWrapper(source)
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:81: in __init__
     filename, fileobject = self.open_log_file(source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <class 'cclib.parser.logfilewrapper.FileWrapper'>
source = 'dummyfile.txt', mode = 'r', encoding = 'utf-8', errors = 'logerror'

     @classmethod
     def open_log_file(
             self,
             source,
             mode: str = "r",
             encoding: str = "utf-8",
             errors: str = "logerror",
         ) -> typing.Tuple[str, typing.IO]:
         """
         Open a possibly compressed file, returning both the filename of the file and an open file object.
         """
         # First, work out what source is (could be a filename, a URL, an open file etc).
         if isinstance(source, str) and URL_PATTERN.match(source):
             # This file is a URL.
             try:
                 # Cache the file to a temp location.
                 response = urlopen(source)
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(response.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)
                 filename = source

             except (ValueError, URLError) as error:
                 # Maybe no need to raise a different exception?
                 raise ValueError(
                     "Encountered an error processing the URL '{}'".format(source)
                 ) from error

         elif hasattr(source, "read") or hasattr(source, "readline"):
             # This file is a file.
             # If this file supports seek, we don't need to do anything.
             # If not, we'll cache it to file.
             if not hasattr(source, "seek") or \
             (hasattr(source, "seekable") and not source.seekable()):
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(source.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)

             else:
                 fileobject = source
             filename = getattr(source, "name", f"stream {str(type(source))}")

         else:
             # This file is something else, assume we can open() it.
             filename = source
             fileobject = None

         filename = pathlib.Path(filename)
         extension = filename.suffix

         if extension == ".gz":
             fileobject = io.TextIOWrapper(gzip.GzipFile(filename, mode, fileobj = fileobject), encoding = encoding, errors = errors)

         elif extension == ".zip":
             fileobject = zipfile.ZipFile(fileobject if fileobject else filename, mode)
             # TODO: Need to check that we're not leaving any open file objects here...
             # TODO: We should be able to handle multiple files...
             assert len(fileobject.namelist()) == 1, "ERROR: Zip file contains more than 1 file"

             fileobject = io.TextIOWrapper(
                 fileobject.open(fileobject.namelist()[0]),
                 encoding = encoding, errors = errors
             )

         elif extension in ['.bz', '.bz2']:
             # Module 'bz2' is not always importable.
             assert bz2 is not None, "ERROR: module bz2 cannot be imported"
             fileobject = io.TextIOWrapper(bz2.BZ2File(fileobject if fileobject else filename, mode), encoding = encoding, errors = errors)

         elif fileobject is not None:
             # Assuming that object is text file encoded in utf-8
             # If the file/stream has already been opened, we have no ability to handle decoding errors.
             pass

         else:
             # Normal text file.
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:210: FileNotFoundError

test/parser/testspecificparsers.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/cclib/parser/gaussianparser.py:25: in __init__
     super().__init__(logname="Gaussian", *args, **kwargs)
/usr/lib/python3/dist-packages/cclib/parser/logfileparser.py:56: in __init__
     source = FileWrapper(source)
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:81: in __init__
     filename, fileobject = self.open_log_file(source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <class 'cclib.parser.logfilewrapper.FileWrapper'>, source = 'dummyfile'
mode = 'r', encoding = 'utf-8', errors = 'logerror'

     @classmethod
     def open_log_file(
             self,
             source,
             mode: str = "r",
             encoding: str = "utf-8",
             errors: str = "logerror",
         ) -> typing.Tuple[str, typing.IO]:
         """
         Open a possibly compressed file, returning both the filename of the file and an open file object.
         """
         # First, work out what source is (could be a filename, a URL, an open file etc).
         if isinstance(source, str) and URL_PATTERN.match(source):
             # This file is a URL.
             try:
                 # Cache the file to a temp location.
                 response = urlopen(source)
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(response.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)
                 filename = source

             except (ValueError, URLError) as error:
                 # Maybe no need to raise a different exception?
                 raise ValueError(
                     "Encountered an error processing the URL '{}'".format(source)
                 ) from error

         elif hasattr(source, "read") or hasattr(source, "readline"):
             # This file is a file.
             # If this file supports seek, we don't need to do anything.
             # If not, we'll cache it to file.
             if not hasattr(source, "seek") or \
             (hasattr(source, "seekable") and not source.seekable()):
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(source.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)

             else:
                 fileobject = source
             filename = getattr(source, "name", f"stream {str(type(source))}")

         else:
             # This file is something else, assume we can open() it.
             filename = source
             fileobject = None

         filename = pathlib.Path(filename)
         extension = filename.suffix

         if extension == ".gz":
             fileobject = io.TextIOWrapper(gzip.GzipFile(filename, mode, fileobj = fileobject), encoding = encoding, errors = errors)

         elif extension == ".zip":
             fileobject = zipfile.ZipFile(fileobject if fileobject else filename, mode)
             # TODO: Need to check that we're not leaving any open file objects here...
             # TODO: We should be able to handle multiple files...
             assert len(fileobject.namelist()) == 1, "ERROR: Zip file contains more than 1 file"

             fileobject = io.TextIOWrapper(
                 fileobject.open(fileobject.namelist()[0]),
                 encoding = encoding, errors = errors
             )

         elif extension in ['.bz', '.bz2']:
             # Module 'bz2' is not always importable.
             assert bz2 is not None, "ERROR: module bz2 cannot be imported"
             fileobject = io.TextIOWrapper(bz2.BZ2File(fileobject if fileobject else filename, mode), encoding = encoding, errors = errors)

         elif fileobject is not None:
             # Assuming that object is text file encoded in utf-8
             # If the file/stream has already been opened, we have no ability to handle decoding errors.
             pass

         else:
             # Normal text file.
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:210: FileNotFoundError

test/parser/testspecificparsers.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/cclib/parser/jaguarparser.py:23: in __init__
     super().__init__(logname="Jaguar", *args, **kwargs)
/usr/lib/python3/dist-packages/cclib/parser/logfileparser.py:56: in __init__
     source = FileWrapper(source)
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:81: in __init__
     filename, fileobject = self.open_log_file(source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <class 'cclib.parser.logfilewrapper.FileWrapper'>, source = 'dummyfile'
mode = 'r', encoding = 'utf-8', errors = 'logerror'

     @classmethod
     def open_log_file(
             self,
             source,
             mode: str = "r",
             encoding: str = "utf-8",
             errors: str = "logerror",
         ) -> typing.Tuple[str, typing.IO]:
         """
         Open a possibly compressed file, returning both the filename of the file and an open file object.
         """
         # First, work out what source is (could be a filename, a URL, an open file etc).
         if isinstance(source, str) and URL_PATTERN.match(source):
             # This file is a URL.
             try:
                 # Cache the file to a temp location.
                 response = urlopen(source)
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(response.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)
                 filename = source

             except (ValueError, URLError) as error:
                 # Maybe no need to raise a different exception?
                 raise ValueError(
                     "Encountered an error processing the URL '{}'".format(source)
                 ) from error

         elif hasattr(source, "read") or hasattr(source, "readline"):
             # This file is a file.
             # If this file supports seek, we don't need to do anything.
             # If not, we'll cache it to file.
             if not hasattr(source, "seek") or \
             (hasattr(source, "seekable") and not source.seekable()):
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(source.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)

             else:
                 fileobject = source
             filename = getattr(source, "name", f"stream {str(type(source))}")

         else:
             # This file is something else, assume we can open() it.
             filename = source
             fileobject = None

         filename = pathlib.Path(filename)
         extension = filename.suffix

         if extension == ".gz":
             fileobject = io.TextIOWrapper(gzip.GzipFile(filename, mode, fileobj = fileobject), encoding = encoding, errors = errors)

         elif extension == ".zip":
             fileobject = zipfile.ZipFile(fileobject if fileobject else filename, mode)
             # TODO: Need to check that we're not leaving any open file objects here...
             # TODO: We should be able to handle multiple files...
             assert len(fileobject.namelist()) == 1, "ERROR: Zip file contains more than 1 file"

             fileobject = io.TextIOWrapper(
                 fileobject.open(fileobject.namelist()[0]),
                 encoding = encoding, errors = errors
             )

         elif extension in ['.bz', '.bz2']:
             # Module 'bz2' is not always importable.
             assert bz2 is not None, "ERROR: module bz2 cannot be imported"
             fileobject = io.TextIOWrapper(bz2.BZ2File(fileobject if fileobject else filename, mode), encoding = encoding, errors = errors)

         elif fileobject is not None:
             # Assuming that object is text file encoded in utf-8
             # If the file/stream has already been opened, we have no ability to handle decoding errors.
             pass

         else:
             # Normal text file.
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:210: FileNotFoundError

test/parser/testspecificparsers.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/cclib/parser/molproparser.py:56: in __init__
     super().__init__(logname="Molpro", *args, **kwargs)
/usr/lib/python3/dist-packages/cclib/parser/logfileparser.py:56: in __init__
     source = FileWrapper(source)
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:81: in __init__
     filename, fileobject = self.open_log_file(source)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <class 'cclib.parser.logfilewrapper.FileWrapper'>, source = 'dummyfile'
mode = 'r', encoding = 'utf-8', errors = 'logerror'

     @classmethod
     def open_log_file(
             self,
             source,
             mode: str = "r",
             encoding: str = "utf-8",
             errors: str = "logerror",
         ) -> typing.Tuple[str, typing.IO]:
         """
         Open a possibly compressed file, returning both the filename of the file and an open file object.
         """
         # First, work out what source is (could be a filename, a URL, an open file etc).
         if isinstance(source, str) and URL_PATTERN.match(source):
             # This file is a URL.
             try:
                 # Cache the file to a temp location.
                 response = urlopen(source)
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(response.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)
                 filename = source

             except (ValueError, URLError) as error:
                 # Maybe no need to raise a different exception?
                 raise ValueError(
                     "Encountered an error processing the URL '{}'".format(source)
                 ) from error

         elif hasattr(source, "read") or hasattr(source, "readline"):
             # This file is a file.
             # If this file supports seek, we don't need to do anything.
             # If not, we'll cache it to file.
             if not hasattr(source, "seek") or \
             (hasattr(source, "seekable") and not source.seekable()):
                 fileobject = NamedTemporaryFile(delete = True)
                 fileobject.write(source.read())
                 fileobject.seek(0,0)

                 fileobject = io.TextIOWrapper(fileobject, encoding = encoding, errors = errors)

             else:
                 fileobject = source
             filename = getattr(source, "name", f"stream {str(type(source))}")

         else:
             # This file is something else, assume we can open() it.
             filename = source
             fileobject = None

         filename = pathlib.Path(filename)
         extension = filename.suffix

         if extension == ".gz":
             fileobject = io.TextIOWrapper(gzip.GzipFile(filename, mode, fileobj = fileobject), encoding = encoding, errors = errors)

         elif extension == ".zip":
             fileobject = zipfile.ZipFile(fileobject if fileobject else filename, mode)
             # TODO: Need to check that we're not leaving any open file objects here...
             # TODO: We should be able to handle multiple files...
             assert len(fileobject.namelist()) == 1, "ERROR: Zip file contains more than 1 file"

             fileobject = io.TextIOWrapper(
                 fileobject.open(fileobject.namelist()[0]),
                 encoding = encoding, errors = errors
             )

         elif extension in ['.bz', '.bz2']:
             # Module 'bz2' is not always importable.
             assert bz2 is not None, "ERROR: module bz2 cannot be imported"
             fileobject = io.TextIOWrapper(bz2.BZ2File(fileobject if fileobject else filename, mode), encoding = encoding, errors = errors)

         elif fileobject is not None:
             # Assuming that object is text file encoded in utf-8
             # If the file/stream has already been opened, we have no ability to handle decoding errors.
             pass

         else:
             # Normal text file.
/usr/lib/python3/dist-packages/cclib/parser/logfilewrapper.py:210: FileNotFoundError
=============================== warnings summary ===============================
test_data.py: 305 warnings
   /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11/build/test/test_data.py:192: DeprecationWarning: unittest.makeSuite() is deprecated and will be removed in Python 3.13. Please use unittest.TestLoader.loadTestsFromTestCase() instead.
     myunittest = unittest.makeSuite(test)