Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Marcus Hoffmann <marcus.hoffmann@othermo.de>
Cc: Davide Viti <zinosat@gmail.com>, Asaf Kahlon <asafka7@gmail.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/python-paho-mqtt: fix package for python 3.10
Date: Wed, 31 Aug 2022 21:43:10 +0200	[thread overview]
Message-ID: <20220831194310.GI68979@scaer> (raw)
In-Reply-To: <20220829173754.214890-1-marcus.hoffmann@othermo.de>

Marcus, All,

On 2022-08-29 19:37 +0200, Marcus Hoffmann spake thusly:
> Fixes the following error on calling mqtt.publish():
> 
>   File "/usr/lib/python3.10/site-packages/paho/mqtt/publish.py", line 222, in single
>     multiple([msg], hostname, port, client_id, keepalive, will, auth, tls,
>   File "/usr/lib/python3.10/site-packages/paho/mqtt/publish.py", line 126, in multiple
>     if not isinstance(msgs, collections.Iterable):
> AttributeError: module 'collections' has no attribute 'Iterable'
> 
> Backported from https://github.com/eclipse/paho.mqtt.python/pull/497/
> 
> This was deprecated in python 3.9 and stopped working in python 3.10
> 
> Signed-off-by: Marcus Hoffmann <marcus.hoffmann@othermo.de>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  .../0001-fix-publish-for-python-3-10.patch    | 37 +++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 package/python-paho-mqtt/0001-fix-publish-for-python-3-10.patch
> 
> diff --git a/package/python-paho-mqtt/0001-fix-publish-for-python-3-10.patch b/package/python-paho-mqtt/0001-fix-publish-for-python-3-10.patch
> new file mode 100644
> index 0000000000..aad6b5d723
> --- /dev/null
> +++ b/package/python-paho-mqtt/0001-fix-publish-for-python-3-10.patch
> @@ -0,0 +1,37 @@
> +From e1c45570f61f9d6b28f8604c8a8cd6dd94f959ed Mon Sep 17 00:00:00 2001
> +From: Brishen Hawkins <brishen.hawkins@gmail.com>
> +Date: Tue, 9 Jun 2020 00:18:39 -0600
> +Subject: [PATCH] Fix for Python 3.9 moving Iterable to collections.abc
> +
> +Signed-off-by: Brishen Hawkins <brishen.hawkins@gmail.com>
> +
> +Backported from: e1c45570f61f9d6b28f8604c8a8cd6dd94f959ed
> +Signed-off-by: Marcus Hoffmann <marcus.hoffmann@othermo.de>
> +---
> + src/paho/mqtt/publish.py | 6 +++++-
> + 1 file changed, 5 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/paho/mqtt/publish.py b/src/paho/mqtt/publish.py
> +index f9f1986e..dcb34ff1 100644
> +--- a/src/paho/mqtt/publish.py
> ++++ b/src/paho/mqtt/publish.py
> +@@ -21,6 +21,10 @@
> + from __future__ import absolute_import
> + 
> + import collections
> ++try:
> ++    from collections.abc import Iterable
> ++except ImportError:
> ++    from collections import Iterable
> + 
> + from . import client as paho
> + from .. import mqtt
> +@@ -124,7 +128,7 @@ def multiple(msgs, hostname="localhost", port=1883, client_id="", keepalive=60,
> +     proxy_args: a dictionary that will be given to the client.
> +     """
> + 
> +-    if not isinstance(msgs, collections.Iterable):
> ++    if not isinstance(msgs, Iterable):
> +         raise TypeError('msgs must be an iterable')
> + 
> +     client = paho.Client(client_id=client_id, userdata=collections.deque(msgs),
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-08-31 19:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 17:37 [Buildroot] [PATCH 1/1] package/python-paho-mqtt: fix package for python 3.10 Marcus Hoffmann
2022-08-31 19:43 ` Yann E. MORIN [this message]
2022-09-18  7:45 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220831194310.GI68979@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=asafka7@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=marcus.hoffmann@othermo.de \
    --cc=zinosat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox