Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-librouteros for openSUSE:Factory checked in at 2021-11-20 02:39:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-librouteros (Old) and /work/SRC/openSUSE:Factory/.python-librouteros.new.1895 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-librouteros" Sat Nov 20 02:39:02 2021 rev:6 rq:932352 version:3.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-librouteros/python-librouteros.changes 2020-12-21 10:26:48.228210245 +0100 +++ /work/SRC/openSUSE:Factory/.python-librouteros.new.1895/python-librouteros.changes 2021-11-20 02:40:09.476578654 +0100 @@ -1,0 +2,6 @@ +Thu Nov 18 20:54:31 UTC 2021 - Martin Hauke <mar...@gmx.de> + +- Update to version 3.2.0 + * Ignore character decoding errors + +------------------------------------------------------------------- Old: ---- librouteros-3.1.0.tar.gz New: ---- librouteros-3.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-librouteros.spec ++++++ --- /var/tmp/diff_new_pack.Xm6Iz3/_old 2021-11-20 02:40:09.996576938 +0100 +++ /var/tmp/diff_new_pack.Xm6Iz3/_new 2021-11-20 02:40:09.996576938 +0100 @@ -1,8 +1,8 @@ # # spec file for package python-librouteros # -# Copyright (c) 2020 SUSE LLC -# Copyright (c) 2017-2020, Martin Hauke <mar...@gmx.de> +# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2017-2021, Martin Hauke <mar...@gmx.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-librouteros -Version: 3.1.0 +Version: 3.2.0 Release: 0 Summary: Python implementation of MikroTik RouterOS API License: GPL-2.0-or-later ++++++ librouteros-3.1.0.tar.gz -> librouteros-3.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/.bumpversion.cfg new/librouteros-3.2.0/.bumpversion.cfg --- old/librouteros-3.1.0/.bumpversion.cfg 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/.bumpversion.cfg 2021-11-15 20:19:38.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 3.1.0 +current_version = 3.2.0 commit = True tag = True tag_name = {new_version} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/.gitattributes new/librouteros-3.2.0/.gitattributes --- old/librouteros-3.1.0/.gitattributes 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/.gitattributes 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -images/routeros_6.33.3.qcow2 filter=lfs diff=lfs merge=lfs -text -images/routeros_6.43rc21.qcow2 filter=lfs diff=lfs merge=lfs -text -images/routeros_6.44.5.qcow2 filter=lfs diff=lfs merge=lfs -text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/.github/dependabot.yml new/librouteros-3.2.0/.github/dependabot.yml --- old/librouteros-3.1.0/.github/dependabot.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/librouteros-3.2.0/.github/dependabot.yml 2021-11-15 20:19:38.000000000 +0100 @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/.github/workflows/ci.yml new/librouteros-3.2.0/.github/workflows/ci.yml --- old/librouteros-3.1.0/.github/workflows/ci.yml 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/.github/workflows/ci.yml 2021-11-15 20:19:38.000000000 +0100 @@ -21,7 +21,10 @@ - name: Checkout uses: actions/checkout@v2 with: - lfs: true + lfs: false + + - name: Move images + run: mv /opt/* $GITHUB_WORKSPACE/images/ - name: Install package run: pipenv --python python3 install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/.pylintrc new/librouteros-3.2.0/.pylintrc --- old/librouteros-3.1.0/.pylintrc 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/.pylintrc 2021-11-15 20:19:38.000000000 +0100 @@ -3,7 +3,7 @@ # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code. -extension-pkg-whitelist= +extension-pkg-allow-list=hexlify,struct # Add files or directories to the blacklist. They should be base names, not # paths. @@ -66,12 +66,13 @@ unidiomatic-typecheck, logging-format-interpolation, trailing-newlines, + logging-fstring-interpolation, # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member +enable= [REPORTS] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/CHANGELOG.rst new/librouteros-3.2.0/CHANGELOG.rst --- old/librouteros-3.1.0/CHANGELOG.rst 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/CHANGELOG.rst 2021-11-15 20:19:38.000000000 +0100 @@ -1,3 +1,8 @@ +3.2.0 +---------- + +* Ignore character decoding errors + 3.1.0 ---------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/docker/3.6.dockerfile new/librouteros-3.2.0/docker/3.6.dockerfile --- old/librouteros-3.1.0/docker/3.6.dockerfile 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/docker/3.6.dockerfile 2021-11-15 20:19:38.000000000 +0100 @@ -6,8 +6,8 @@ RUN apt-get install -y --no-install-recommends \ qemu-system-i386 \ qemu-utils \ - wget \ - git-lfs + wget -RUN pip install pipenv -RUN pip install twine +COPY images/*.qcow2 /opt/ +RUN pip install -U setuptools pip +RUN pip install twine pipenv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/docker/3.7.dockerfile new/librouteros-3.2.0/docker/3.7.dockerfile --- old/librouteros-3.1.0/docker/3.7.dockerfile 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/docker/3.7.dockerfile 2021-11-15 20:19:38.000000000 +0100 @@ -6,8 +6,8 @@ RUN apt-get install -y --no-install-recommends \ qemu-system-i386 \ qemu-utils \ - wget \ - git-lfs + wget -RUN pip install pipenv -RUN pip install twine +COPY images/*.qcow2 /opt/ +RUN pip install -U setuptools pip +RUN pip install twine pipenv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/docker/3.8.dockerfile new/librouteros-3.2.0/docker/3.8.dockerfile --- old/librouteros-3.1.0/docker/3.8.dockerfile 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/docker/3.8.dockerfile 2021-11-15 20:19:38.000000000 +0100 @@ -6,8 +6,8 @@ RUN apt-get install -y --no-install-recommends \ qemu-system-i386 \ qemu-utils \ - wget \ - git-lfs + wget -RUN pip install pipenv -RUN pip install twine +COPY images/*.qcow2 /opt/ +RUN pip install -U setuptools pip +RUN pip install twine pipenv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/images/.gitignore new/librouteros-3.2.0/images/.gitignore --- old/librouteros-3.1.0/images/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/librouteros-3.2.0/images/.gitignore 2021-11-15 20:19:38.000000000 +0100 @@ -0,0 +1 @@ +*.qcow2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/images/routeros_6.33.3.qcow2 new/librouteros-3.2.0/images/routeros_6.33.3.qcow2 --- old/librouteros-3.1.0/images/routeros_6.33.3.qcow2 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/images/routeros_6.33.3.qcow2 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be3b9d982d1ffc893ad50d5295a5f4e55f222eb6088cd52ba8d453a6da800a28 -size 46006272 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/images/routeros_6.43rc21.qcow2 new/librouteros-3.2.0/images/routeros_6.43rc21.qcow2 --- old/librouteros-3.1.0/images/routeros_6.43rc21.qcow2 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/images/routeros_6.43rc21.qcow2 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72579f09778acd8023cf0b467801378373042cc8dc2492121271081cd9914115 -size 37027840 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/images/routeros_6.44.5.qcow2 new/librouteros-3.2.0/images/routeros_6.44.5.qcow2 --- old/librouteros-3.1.0/images/routeros_6.44.5.qcow2 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/images/routeros_6.44.5.qcow2 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a58b18c702b046622f86d68255252135dc5b660a5f8a71989a0e4e95072d3cd -size 36241408 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/librouteros/api.py new/librouteros-3.2.0/librouteros/api.py --- old/librouteros-3.1.0/librouteros/api.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/librouteros/api.py 2021-11-15 20:19:38.000000000 +0100 @@ -101,11 +101,7 @@ return self.path def __repr__(self) -> str: - return "<{module}.{cls} {path!r}>".format( - module=self.__class__.__module__, - cls=self.__class__.__name__, - path=self.path, - ) + return f"<{self.__class__.__name__} {self}>" def __iter__(self) -> ResponseIter: yield from self('print') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/librouteros/exceptions.py new/librouteros-3.2.0/librouteros/exceptions.py --- old/librouteros-3.1.0/librouteros/exceptions.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/librouteros/exceptions.py 2021-11-15 20:19:38.000000000 +0100 @@ -35,7 +35,7 @@ return str(self.message.replace('\r\n', ',')) def __repr__(self) -> str: - return '{}({!r})'.format(self.__class__.__name__, str(self)) + return f'{self.__class__.__name__}({self})' class MultiTrapError(ProtocolError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/librouteros/login.py new/librouteros-3.2.0/librouteros/login.py --- old/librouteros-3.1.0/librouteros/login.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/librouteros/login.py 2021-11-15 20:19:38.000000000 +0100 @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- import typing -from binascii import unhexlify, hexlify +from binascii import unhexlify, hexlify #pylint: disable=no-name-in-module from hashlib import md5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/librouteros/protocol.py new/librouteros-3.2.0/librouteros/protocol.py --- old/librouteros-3.1.0/librouteros/protocol.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/librouteros/protocol.py 2021-11-15 20:19:38.000000000 +0100 @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- import typing -from struct import pack, unpack +from struct import pack, unpack #pylint: disable=no-name-in-module from logging import getLogger, NullHandler from librouteros.exceptions import ( @@ -46,7 +46,7 @@ Create a attribute word from key, value pair. Values are casted to api equivalents. """ - return '={}={}'.format(key, cast_to_api(value)) + return f'={key}={cast_to_api(value)}' class Encoder: @@ -95,7 +95,7 @@ ored_length = length | 0xE0000000 offset = -4 else: - raise ProtocolError('Unable to encode length of {}'.format(length)) + raise ProtocolError(f'Unable to encode length of {length}') return pack('!I', ored_length)[offset:] @@ -123,7 +123,7 @@ elif integer < 240: return 3 - raise ProtocolError('Unknown controll byte {!r}'.format(length)) + raise ProtocolError(f'Unknown controll byte {length!r}') @staticmethod def decodeLength(length: bytes) -> int: @@ -148,7 +148,7 @@ offset = b'' xor = 0xE0000000 else: - raise ProtocolError('Unable to decode length of {!r}'.format(length)) + raise ProtocolError(f'Unable to decode length of {length!r}') decoded: int = unpack('!I', (offset + length))[0] decoded ^= xor @@ -164,9 +164,8 @@ @staticmethod def log(direction_string: str, *sentence: str) -> None: for word in sentence: - LOGGER.debug('{0} {1!r}'.format(direction_string, word)) - - LOGGER.debug('{0} EOS'.format(direction_string)) + LOGGER.debug(f'{direction_string} {word!r}') + LOGGER.debug(f'{direction_string} EOS') def writeSentence(self, cmd: str, *words: str) -> None: """ @@ -202,7 +201,7 @@ byte += self.transport.read(to_read) length = self.decodeLength(byte) word = self.transport.read(length) - return word.decode(encoding=self.encoding, errors='strict') + return word.decode(encoding=self.encoding, errors='ignore') def close(self) -> None: self.transport.close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/librouteros/query.py new/librouteros-3.2.0/librouteros/query.py --- old/librouteros-3.1.0/librouteros/query.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/librouteros/query.py 2021-11-15 20:19:38.000000000 +0100 @@ -16,17 +16,17 @@ self.name = name def __eq__(self, other): - yield '?={}={}'.format(self, cast_to_api(other)) + yield f'?={self}={cast_to_api(other)}' def __ne__(self, other): yield from self == other yield '?#!' def __lt__(self, other): - yield '?<{}={}'.format(self, cast_to_api(other)) + yield f'?<{self}={cast_to_api(other)}' def __gt__(self, other): - yield '?>{}={}'.format(self, cast_to_api(other)) + yield f'?>{self}={cast_to_api(other)}' def __str__(self) -> str: return str(self.name) @@ -52,7 +52,7 @@ def __iter__(self) -> ResponseIter: keys = ','.join(str(key) for key in self.keys) - keys = '=.proplist={}'.format(keys) + keys = f'=.proplist={keys}' cmd = str(self.path.join('print')) return iter(self.api.rawCmd(cmd, keys, *self.query)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/pyproject.toml new/librouteros-3.2.0/pyproject.toml --- old/librouteros-3.1.0/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/librouteros-3.2.0/pyproject.toml 2021-11-15 20:19:38.000000000 +0100 @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta:__legacy__" \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/setup.cfg new/librouteros-3.2.0/setup.cfg --- old/librouteros-3.1.0/setup.cfg 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/setup.cfg 2021-11-15 20:19:38.000000000 +0100 @@ -1,5 +1,5 @@ [tool:pytest] -addopts = --strict -ra +addopts = -ra [yapf] based_on_style = pep8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/setup.py new/librouteros-3.2.0/setup.py --- old/librouteros-3.1.0/setup.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/setup.py 2021-11-15 20:19:38.000000000 +0100 @@ -28,7 +28,7 @@ setup_requires=setup_pkgs, zip_safe=False, name='librouteros', - version='3.1.0', + version='3.2.0', description='Python implementation of MikroTik RouterOS API', long_description=read('README.rst'), author='??ukasz Kostka', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/librouteros-3.1.0/tests/unit/test_protocol.py new/librouteros-3.2.0/tests/unit/test_protocol.py --- old/librouteros-3.1.0/tests/unit/test_protocol.py 2020-12-17 23:52:59.000000000 +0100 +++ new/librouteros-3.2.0/tests/unit/test_protocol.py 2021-11-15 20:19:38.000000000 +0100 @@ -97,7 +97,7 @@ def setup(self): self.protocol = ApiProtocol( transport=MagicMock(spec=SocketTransport), - encoding='ASCII', + encoding='utf-8', ) @patch.object(Encoder, 'encodeSentence') @@ -119,6 +119,12 @@ assert str(error.value) == 'reason' assert self.protocol.transport.close.call_count == 1 + def test_decoding_ignores_character_errors(self): + word = b'\x11\xfb\x95' + '??????'.encode('utf-8') + length = Encoder.encodeLength(len(word)) + self.protocol.transport.read.side_effect = (length, b'', word) + assert self.protocol.readWord() == '\x11??????' + def test_close(self): self.protocol.close() self.protocol.transport.close.assert_called_once_with()