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 3D8D5A0525; 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 36EF62C23; Mon, 20 Jan 2020 09:47:10 +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 D05942BF5 for ; Mon, 20 Jan 2020 09:47:08 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id c9so28560023wrw.8 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=fbhtNmdZf3OEKhdZ/DmdWWW6CdemfBOLjTTXFri4ium0at4D2NX+8psNmumz3qqwIw VXpj3aWse92lhTYbCGh2QL9MCgHzw5/q2Bq7sUgGg0X6tOCqGHzOFMGx6dadKKDCJM9i ww6Gbr1trg825G2L9gMhDz05RzzhCAa8enEowo3/fsNGH3Np8NJKz8eM3XgN0iutMR/y 1I04w325F9PGHLPzXO663/yEGyUIzqCleSpyOAhRCV/dExOv5z5DAabyJUi3A74Xl+GA 3+gjc6pknrrU3jc2RYhuF0G/kCwWfRh8bB+n2B8DRHINlSuOZttgBLrNIWCQexUmt5Eq S17g== X-Gm-Message-State: APjAAAUvi2U3hDrfdZZPG+M+cHzK8dXu0jLHWgdCkxNOXN2V5gxA/6KX IG1CCYccqfmuAFE1jY7XFOCljQ== 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-dev] [dpdk-stable] [PATCH] usertools: add telemetry python3 compatibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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