[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.18] tools/pygrub: Fix pygrub's --entry flag for python3


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Wed, 11 Oct 2023 13:41:21 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZFUmOvOQrIMCfnKWS26Mjn70ytbwShNwwo3vXlyUw38=; b=hkBD/MNgxtfB73DyOmPAgIWIPyUXJGi1s83vm5Fw+tWvmThW08Ufrbg13qDcgw15lzJHIIjC5h9hEz/W7y+PvmtYG9U3fbkSkpjl1OpyIKr6F9oA2qUvTWqMYSA7TtW1ekQm6ClEr8uZ/U/WspvbNjd7uJ6ib547PnQ+6YxeAy4ID270/LOuXsKvIyo89p49IFGLFnMmT9KFdiPXTkT9/7fct20U8DnIGXsNfhXL3Kw1vj4TM8zWZTOIZVV7elPz2L5OQ1IWOpowBc5whekrvP6deDDBqQ7RUzQPtYgAKlwBsND3q1h/hVUdhC6XnMjdAlJ2Aq/JzhxYiJWn8usvqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KcCA+kKUnesFRraSMhLGZSs0/x3XFntNSaU8vRelWBQj7TCUnEPKJMJasJZf7oWyZszKw6ME8MpG7TZ5563q5RDhiMFpZcNTD2G8ZS+rfzYMm8CeMIjtrO4Tp7JKVnhyjAWRBjh9FlRNwZcG2DW60VD9HoO7u40MJddLB6oFvUMrsHTnyrQxHCjbyd1Du6L+68zV8k1Qr2RFq040rMYnf228Bf0QrfiZQK0nYzsPFIHVSbYtr6H3NKgz6QkCOqx9Mmdifikb/pcBUy7P3uQ5ZlbmndcoQHb1baVWpaRkpga2CjrS3BvV+kDWlz9XPxJx6l2iRvNxG/GB+rmEs9ka9w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 11 Oct 2023 13:42:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ/EhwoShlUm8+hUyEFVohORc7NbBEmKCA
  • Thread-topic: [PATCH for-4.18] tools/pygrub: Fix pygrub's --entry flag for python3

Hi Andrew, Alejandro,

> On Oct 11, 2023, at 21:39, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> On 11/10/2023 8:25 pm, Alejandro Vallejo wrote:
>> string.atoi() has been deprecated since Python 2.0, has a big scary warning
>> in the python2.7 docs and is absent from python3 altogether. int() does the
>> same thing and is compatible with both.
>> 
>> See https://docs.python.org/2/library/string.html#string.atoi:
>> 
>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
>> ---
>> tools/pygrub/src/pygrub | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
>> index dcdfc04ff0..541e562327 100755
>> --- a/tools/pygrub/src/pygrub
>> +++ b/tools/pygrub/src/pygrub
>> @@ -731,7 +731,7 @@ class Grub:
>> def get_entry_idx(cf, entry):
>>     # first, see if the given entry is numeric
>>     try:
>> -        idx = string.atoi(entry)
>> +        idx = int(entry)
>>         return idx
>>     except ValueError:
>>         pass
> 
> CC Henry for 4.18.  This was discovered late in the XSA-443 work and is
> one small extra bit of Python3 work.

Thanks.

Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry


> 
> Thanks,
> 
> ~Andrew




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.