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 2022-09-30 17:57:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-librouteros (Old)
 and      /work/SRC/openSUSE:Factory/.python-librouteros.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-librouteros"

Fri Sep 30 17:57:53 2022 rev:9 rq:1007072 version:3.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-librouteros/python-librouteros.changes    
2022-03-24 22:57:54.968245650 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-librouteros.new.2275/python-librouteros.changes
  2022-09-30 17:58:11.105298714 +0200
@@ -1,0 +2,6 @@
+Thu Sep 29 14:49:07 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com>
+
+- Update to version 3.2.1
+  * Fix non ASCII API word encoding 
+
+-------------------------------------------------------------------

Old:
----
  librouteros-3.2.0.tar.gz

New:
----
  librouteros-3.2.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-librouteros.spec ++++++
--- /var/tmp/diff_new_pack.ymV0wt/_old  2022-09-30 17:58:12.329301331 +0200
+++ /var/tmp/diff_new_pack.ymV0wt/_new  2022-09-30 17:58:12.333301339 +0200
@@ -20,7 +20,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-librouteros
-Version:        3.2.0
+Version:        3.2.1
 Release:        0
 Summary:        Python implementation of MikroTik RouterOS API
 License:        GPL-2.0-or-later

++++++ librouteros-3.2.0.tar.gz -> librouteros-3.2.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/.bumpversion.cfg 
new/librouteros-3.2.1/.bumpversion.cfg
--- old/librouteros-3.2.0/.bumpversion.cfg      2021-11-15 20:19:38.000000000 
+0100
+++ new/librouteros-3.2.1/.bumpversion.cfg      2022-05-24 17:46:16.000000000 
+0200
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 3.2.0
+current_version = 3.2.1
 commit = True
 tag = True
 tag_name = {new_version}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/.github/workflows/ci.yml 
new/librouteros-3.2.1/.github/workflows/ci.yml
--- old/librouteros-3.2.0/.github/workflows/ci.yml      2021-11-15 
20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/.github/workflows/ci.yml      2022-05-24 
17:46:16.000000000 +0200
@@ -17,6 +17,7 @@
           - 3.6
           - 3.7
           - 3.8
+          - 3.9
     steps:
       - name: Checkout
         uses: actions/checkout@v2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/CHANGELOG.rst 
new/librouteros-3.2.1/CHANGELOG.rst
--- old/librouteros-3.2.0/CHANGELOG.rst 2021-11-15 20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/CHANGELOG.rst 2022-05-24 17:46:16.000000000 +0200
@@ -1,3 +1,8 @@
+3.2.1
+----------
+
+* Fix non ASCII API word encoding
+
 3.2.0
 ----------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/Pipfile 
new/librouteros-3.2.1/Pipfile
--- old/librouteros-3.2.0/Pipfile       2021-11-15 20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/Pipfile       2022-05-24 17:46:16.000000000 +0200
@@ -14,3 +14,4 @@
 bumpversion = "*"
 twine = "*"
 pytest-xdist = "*"
+toml = "*"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/docker/3.6.dockerfile 
new/librouteros-3.2.1/docker/3.6.dockerfile
--- old/librouteros-3.2.0/docker/3.6.dockerfile 2021-11-15 20:19:38.000000000 
+0100
+++ new/librouteros-3.2.1/docker/3.6.dockerfile 2022-05-24 17:46:16.000000000 
+0200
@@ -1,13 +1,13 @@
-FROM python:3.6
+FROM python:3.6-slim
 
 ENV DEBIAN_FRONTEND noninteractive
 
-RUN apt-get update
-RUN apt-get install -y --no-install-recommends \
+RUN apt-get update; \
+    apt-get install -y --no-install-recommends --no-install-suggests \
       qemu-system-i386 \
-      qemu-utils \
-      wget
+      qemu-utils; \
+  pip install --no-cache-dir -U setuptools pip twine pipenv; \
+  apt-get purge -y --auto-remove -o 
APT::AutoRemove::RecommendsImportant=false; \
+  rm -rf /var/lib/apt/lists/*
 
 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.2.0/docker/3.7.dockerfile 
new/librouteros-3.2.1/docker/3.7.dockerfile
--- old/librouteros-3.2.0/docker/3.7.dockerfile 2021-11-15 20:19:38.000000000 
+0100
+++ new/librouteros-3.2.1/docker/3.7.dockerfile 2022-05-24 17:46:16.000000000 
+0200
@@ -1,13 +1,13 @@
-FROM python:3.7
+FROM python:3.7-slim
 
 ENV DEBIAN_FRONTEND noninteractive
 
-RUN apt-get update
-RUN apt-get install -y --no-install-recommends \
+RUN apt-get update; \
+    apt-get install -y --no-install-recommends --no-install-suggests \
       qemu-system-i386 \
-      qemu-utils \
-      wget
+      qemu-utils; \
+  pip install --no-cache-dir -U setuptools pip twine pipenv; \
+  apt-get purge -y --auto-remove -o 
APT::AutoRemove::RecommendsImportant=false; \
+  rm -rf /var/lib/apt/lists/*
 
 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.2.0/docker/3.8.dockerfile 
new/librouteros-3.2.1/docker/3.8.dockerfile
--- old/librouteros-3.2.0/docker/3.8.dockerfile 2021-11-15 20:19:38.000000000 
+0100
+++ new/librouteros-3.2.1/docker/3.8.dockerfile 2022-05-24 17:46:16.000000000 
+0200
@@ -1,13 +1,13 @@
-FROM python:3.8
+FROM python:3.8-slim
 
 ENV DEBIAN_FRONTEND noninteractive
 
-RUN apt-get update
-RUN apt-get install -y --no-install-recommends \
+RUN apt-get update; \
+    apt-get install -y --no-install-recommends --no-install-suggests \
       qemu-system-i386 \
-      qemu-utils \
-      wget
+      qemu-utils; \
+  pip install --no-cache-dir -U setuptools pip twine pipenv; \
+  apt-get purge -y --auto-remove -o 
APT::AutoRemove::RecommendsImportant=false; \
+  rm -rf /var/lib/apt/lists/*
 
 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.2.0/docker/3.9.dockerfile 
new/librouteros-3.2.1/docker/3.9.dockerfile
--- old/librouteros-3.2.0/docker/3.9.dockerfile 1970-01-01 01:00:00.000000000 
+0100
+++ new/librouteros-3.2.1/docker/3.9.dockerfile 2022-05-24 17:46:16.000000000 
+0200
@@ -0,0 +1,13 @@
+FROM python:3.9-slim
+
+ENV DEBIAN_FRONTEND noninteractive
+
+RUN apt-get update; \
+    apt-get install -y --no-install-recommends --no-install-suggests \
+      qemu-system-i386 \
+      qemu-utils; \
+  pip install --no-cache-dir -U setuptools pip twine pipenv; \
+  apt-get purge -y --auto-remove -o 
APT::AutoRemove::RecommendsImportant=false; \
+  rm -rf /var/lib/apt/lists/*
+
+COPY images/*.qcow2 /opt/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/docker/do.sh 
new/librouteros-3.2.1/docker/do.sh
--- old/librouteros-3.2.0/docker/do.sh  2021-11-15 20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/docker/do.sh  2022-05-24 17:46:16.000000000 +0200
@@ -1,7 +1,6 @@
 #!/bin/sh
 
-for ver in 3.6 3.7 3.8
+for ver in 3.6 3.7 3.8 3.9
 do
-  docker build -t lukaszkostka/librouteros:${ver} -f docker/${ver}.dockerfile .
-  docker push lukaszkostka/librouteros:${ver}
+  docker buildx build --platform linux/amd64,linux/arm64 --push -t 
lukaszkostka/librouteros:${ver} -f docker/${ver}.dockerfile .
 done
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/docs/_static/custom.css 
new/librouteros-3.2.1/docs/_static/custom.css
--- old/librouteros-3.2.0/docs/_static/custom.css       1970-01-01 
01:00:00.000000000 +0100
+++ new/librouteros-3.2.1/docs/_static/custom.css       2022-05-24 
17:46:16.000000000 +0200
@@ -0,0 +1,6 @@
+div.body p, div.body dd, div.body li, div.body blockquote {
+    -moz-hyphens: none;
+    -ms-hyphens: none;
+    -webkit-hyphens: none;
+    hyphens: none;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/docs/conf.py 
new/librouteros-3.2.1/docs/conf.py
--- old/librouteros-3.2.0/docs/conf.py  2021-11-15 20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/docs/conf.py  2022-05-24 17:46:16.000000000 +0200
@@ -65,4 +65,7 @@
 
 html_theme_options = {
     'fixed_sidebar': True,
+    'github_user': 'luqasz',
+    'github_repo': 'librouteros',
+    'page_width': '1000px',
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/docs/connect.rst 
new/librouteros-3.2.1/docs/connect.rst
--- old/librouteros-3.2.0/docs/connect.rst      2021-11-15 20:19:38.000000000 
+0100
+++ new/librouteros-3.2.1/docs/connect.rst      2022-05-24 17:46:16.000000000 
+0200
@@ -11,7 +11,7 @@
         username='admin',
         password='abc',
         host='some.address.com',
-    )
+        )
 
 Encrypted
 ---------
@@ -44,7 +44,10 @@
 .. code-block:: python
 
     from functools import partial
-    ssl_wrapper=partial(ctx.wrap_socket, server_hostname='some.address.com')
+    ssl_wrapper=partial(
+        ctx.wrap_socket,
+        server_hostname='some.address.com',
+        )
 
 Auth methods
 ------------
@@ -60,7 +63,12 @@
     method = plain
     # for pre 6.43 (with token)
     method = token
-    api = connect(username='admin', password='abc', host='some.address.com', 
login_method=method)
+    api = connect(
+        username='admin',
+        password='abc',
+        host='some.address.com',
+        login_method=method,
+        )
 
 .. note::
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/librouteros/protocol.py 
new/librouteros-3.2.1/librouteros/protocol.py
--- old/librouteros-3.2.0/librouteros/protocol.py       2021-11-15 
20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/librouteros/protocol.py       2022-05-24 
17:46:16.000000000 +0200
@@ -72,7 +72,7 @@
         """
         #pylint: disable=no-member
         encoded_word = word.encode(encoding=self.encoding, errors='strict') # 
type: ignore
-        return Encoder.encodeLength(len(word)) + encoded_word
+        return Encoder.encodeLength(len(encoded_word)) + encoded_word
 
     @staticmethod
     def encodeLength(length: int) -> bytes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/setup.py 
new/librouteros-3.2.1/setup.py
--- old/librouteros-3.2.0/setup.py      2021-11-15 20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/setup.py      2022-05-24 17:46:16.000000000 +0200
@@ -28,7 +28,7 @@
     setup_requires=setup_pkgs,
     zip_safe=False,
     name='librouteros',
-    version='3.2.0',
+    version='3.2.1',
     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.2.0/tests/unit/conftest.py 
new/librouteros-3.2.1/tests/unit/conftest.py
--- old/librouteros-3.2.0/tests/unit/conftest.py        2021-11-15 
20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/tests/unit/conftest.py        2022-05-24 
17:46:16.000000000 +0200
@@ -12,12 +12,6 @@
     return b'\xff\xff\xff\xff\xff'
 
 
-@pytest.fixture(scope='function')
-def bad_length_int():
-    """Length must be < 268435456"""
-    return 268435456
-
-
 @pytest.fixture(
     scope='function',
     params=(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/librouteros-3.2.0/tests/unit/test_protocol.py 
new/librouteros-3.2.1/tests/unit/test_protocol.py
--- old/librouteros-3.2.0/tests/unit/test_protocol.py   2021-11-15 
20:19:38.000000000 +0100
+++ new/librouteros-3.2.1/tests/unit/test_protocol.py   2022-05-24 
17:46:16.000000000 +0200
@@ -59,15 +59,11 @@
         result = self.encoder.encodeLength(valid_word_length.integer)
         assert result == valid_word_length.encoded
 
-    def test_encodeLength_raises_if_lenghth_is_too_big(self, bad_length_int):
+    def test_encodeLength_raises_if_lenghth_is_too_big(self):
+        """Length must be < 268435456"""
+        invalid = 268435456
         with pytest.raises(ProtocolError) as error:
-            self.encoder.encodeLength(bad_length_int)
-        assert str(bad_length_int) in str(error.value)
-
-    @patch.object(Encoder, 'encodeLength', return_value=b'len_')
-    def test_encodeWord(self, encodeLength_mock):
-        assert self.encoder.encodeWord('word') == b'len_word'
-        assert encodeLength_mock.call_count == 1
+            self.encoder.encodeLength(invalid)
 
     def test_non_ASCII_word_encoding(self):
         """When encoding is ASCII, word may only contain ASCII characters."""
@@ -75,10 +71,18 @@
         with pytest.raises(UnicodeEncodeError):
             self.encoder.encodeWord(u'????')
 
-    def test_utf_8_word_encoding(self):
-        """Assert that utf-8 encoding works."""
+    @patch.object(Encoder, 'encodeLength', return_value=b'')
+    def test_utf_8_word_encoding(self, enc_len_mock):
+        """
+        Assert that len is taken from bytes, not utf8 word itself.
+
+        len('??') == 1
+        '??'.encode(encoding='UTF8') == 2
+        """
         self.encoder.encoding = 'utf-8'
-        assert self.encoder.encodeWord(u'????').endswith(b'\xc5\x82\xc4\x85')
+        word = '??'
+        self.encoder.encodeWord(word)
+        
enc_len_mock.assert_called_once_with(len(word.encode(self.encoder.encoding)))
 
     @patch.object(Encoder, 'encodeWord', return_value=b'')
     def test_encodeSentence(self, encodeWord_mock):

Reply via email to