From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED394A0526 for ; Mon, 20 Jan 2020 09:47:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBF4A343C; Mon, 20 Jan 2020 09:47:11 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id D3DFA2C23 for ; Mon, 20 Jan 2020 09:47:08 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id t2so28570763wrr.1 for ; Mon, 20 Jan 2020 00:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6rZDHYcpzDdza7h39VIx/XN6cQ3ZjeNYqbWI0kPgiJ0=; b=iJVK6TdUbtPtFuG+9gDO5llsGg3SW7miJQI8b4dZTwAV9DEYrUwQtQz/QWLezYumos HYTTxn8356ngOFraGAELNROnXnCyNl0Jg+c/j2H22k2sJu6RCyMvSY1F5z7GrTJEGpks pioNm1VVkNMZuh9LFV6Al1/qlGEtWlJ7/EFmnyDsnqPdqA5hw4WJsVrl+KClzUVJ91Mt A7NHhAfsCrCL5MCJK9Vzijt/vbBtUo1Cl5OynVcpcjB5vwhk7DqB7fDCFMsMWvPXvEPV rqp+6SSFgi/9VFge/FclMcKwxI0NRjeMUp8K168q6ZuWF38ILxlYaDh2uwoZkWcTebja 7DLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6rZDHYcpzDdza7h39VIx/XN6cQ3ZjeNYqbWI0kPgiJ0=; b=S1zmJRqC5Xfj9HZQbIOR9L8yY5ewB1Sp966x/2MhCLCYI+vqAjYP+sCXKrJeuHkotE KikpFPaUsloxKDwRsOnr0nNh1Phg2vYdi7OLagHLeEsjoYyLXN5Ixnh4v7dZDWOblXWV mVTzlgRZNASFgqSzv7gBKAbZjpjDGK0DgX/iKArFcWVH0FqEeTgzaDSymK2lhhIWYC1h D5HAiheCyu11YXemv4gBH0RKx5diR3jtPO/UpQxTqVtxPjOJpJRiK73AqNsFhKnqtmMC KbtKDJtQ4ZC45V/5nSsEXdXM6fO+oNyX0F/aPXQsxR9o8gtKsFq1kxlRqBzED1nmOC9t eWUg== X-Gm-Message-State: APjAAAXRj4dIqtPFdbfO5mSC/NS7Y5/hbubasqTi48m3OOW6UQC5KRSp Zzg/Z7Q4AjyeNt851uT0iIWKgw== X-Google-Smtp-Source: APXvYqz2lhRG7UnEMfbISUjmkIsiwvbzSN3ZUzKnIx7wgnkadcs6A4ei7w5cT/FPq79MugNAXj8alw== X-Received: by 2002:adf:fc03:: with SMTP id i3mr17431820wrr.306.1579510028491; Mon, 20 Jan 2020 00:47:08 -0800 (PST) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id k13sm46459547wrx.59.2020.01.20.00.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 00:47:07 -0800 (PST) Date: Mon, 20 Jan 2020 09:47:07 +0100 From: Robin Jarry To: Thomas Monjalon Cc: Ciara Power , kevin.laatz@intel.com, stable@dpdk.org, dev@dpdk.org Message-ID: <20200120084707.kgo6346unadkpzzo@6wind.com> References: <20200116172425.19246-1-ciara.power@intel.com> <2200875.3c9HiEOlIg@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2200875.3c9HiEOlIg@xps> User-Agent: NeoMutt/20180716 Subject: Re: [dpdk-stable] [PATCH] usertools: add telemetry python3 compatibility X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 16/01/2020 18:24, Ciara Power: > The client script for use with the telemetry library did not support > python3, as the data being sent over the socket was in string format. > Python3 requires the data be explicitly converted to bytes before being > sent. Similarily, the received bytes need to be decoded into string > format. > > Cc: stable@dpdk.org > > Signed-off-by: Ciara Power Overall, it looks good to me. One minor grudge: Mind that when using this script with python2, the literal strings actually are bytes. This means that .encode() does not make any sense on them. As it turns out, the str objects of python2 do have an .encode() method that does not do anything (it returns the byte string object unchanged), so calling it does not cause any problem. Long story short, for consistency you should consider adding a future import at the top: from __future__ import unicode_literals So that all literal strings are unicode with python2 as with python3. See related commit 4da069194ef4 ("usertools: fix pmdinfo with python 3 and pyelftools>=0.24"). Maybe the patch title should contain the word "fix" and some Fixes: lines as there already were some attemps to make this script python3 compatible. Reviewed-by: Robin Jarry -- Robin