Received: by 10.192.165.148 with SMTP id m20csp5384604imm; Tue, 1 May 2018 14:07:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpHcCIQygJLdBmLsBRrShI/yHCKzjs+jDqXNP1R+lkPpVKSEK7lDrfXCKoDpT7m7hHIx+NQ X-Received: by 2002:a17:902:8d8e:: with SMTP id v14-v6mr17790232plo.387.1525208854437; Tue, 01 May 2018 14:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525208854; cv=none; d=google.com; s=arc-20160816; b=zr31nGDaaQKwPvEq5VUupNLnDak/vNPUJbBgqewm6BGdEyaHrJ0VqELq0Y/hp5ZC9l pArAfbJWDX6jCjuYbfqt3HaJY4levfuAleXLuwpOrskScmQWM2sxJCJ4IVJyXi5nj7SZ ir1ID9/9ofrUSJY0Fn4Gzd8u0vP3uruRNGMXNDKQugxbe+e+eYnyY6lkoQCi3TH69JqY e8YuE/Qb9cKpWRT65q78Wx8PBrizPFHl5QnuJglFeZm0s+5rhzQVDXBSGkvlGxftx+gU XPFhkfy/YrjXeddZxr97es/JmOn+vw9RHLR6NvD9fF43ssvVeGreIMPPuSWSiCw1fUgR jnHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=erfQmZTJ3u5c5/zsz4r0hzN2ctnJEja2ZbB4f6CSLl0=; b=bAK1EL5h+pE60O3ntCi7QTANdoqt/JyDg2G9TUzmqSEkYzGhYcZNcPwawt6HDetEGM PjNOxgSrHRbUNlzNkjvvtsl+lM+AK063hSEuBo58IwfrBDQfDW3MFDxIrdmlErm9p6AY 3NZqImSItX9a4UA8Y/sz65DXMG2sDNFUfEWwX1IxM4aluWWKvyzlyTb8JLJxE1XsjNI7 t9ij5mlE2L7/ldKPVkLLOvS+a1hZngPHe3/JVkGDez8FOrHryusFamOW8IFbtfI0Ubg5 dIAtvo+XE91uC5AAJi1/hVnO7YSswlWn/DvP3y+soOyPynPyB4Xf7nTJDnOpprqhNtpx IylQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PpcdZiNM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m4-v6si10620500pll.438.2018.05.01.14.07.19; Tue, 01 May 2018 14:07:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PpcdZiNM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbeEAVHF (ORCPT + 99 others); Tue, 1 May 2018 17:07:05 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:39503 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbeEAVHE (ORCPT ); Tue, 1 May 2018 17:07:04 -0400 Received: by mail-ot0-f195.google.com with SMTP id l12-v6so14283357oth.6; Tue, 01 May 2018 14:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=erfQmZTJ3u5c5/zsz4r0hzN2ctnJEja2ZbB4f6CSLl0=; b=PpcdZiNMNn/wFxd+ks+vHVEeKP8p/yxos2Mj9zbz0Nazfy17RYLCO6h2ki9gWKTuM0 /kDeIOyWU7RJwxTtWWbceDXN+O/D2oxMcqJ5wgYPN4ZhleD6mtyri4507B38+BMdmsSW 0YU617vKpSwu3dK8hCuVn2s5ybRauxFM51nsQS4JH1JZxaLTQwiLzXyySgSIPhO8q3nU jM8IGcdBA+IH5wuIYN+wqhSDn5DHyCAPqisbOzT1ZQyLthjopUK5O0yo4Al6S1OyJ7Cx o4WPq1jBwc+dZv9M7kVkOWkPaGVFBluPo9kYjAPqB0NhbG5i8fpxEfLmvTGZGsXIrhxy N18Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=erfQmZTJ3u5c5/zsz4r0hzN2ctnJEja2ZbB4f6CSLl0=; b=oBcjXU2g2Zgo2MofmF1WC1HA0w5lyUvWNvXHF5vOLCIKN7Ulb8Ty7lbQBMTHtitEI8 vWOYRz1OU8D81Q9wLoheJhWwwSxktDA5tK45heD/nMLg497GDJd2rtil3XmwKUR5UtWQ rKi8MecqJHVXto4M3PTsu1zDyaniuEX718cebX+EkhZosYWWlhHjWTWDeG6aZ+ykx9z3 D+OcGrEJBfcCXQcZPBro/phjNDnGvdMg+aGrZi8TyJ1KunndFFUm1Kuq55LOMltFfV2h 2pcyp3LpBe4WJwCg339IeDimkPz1asCBYoGe07wl3F6Fk+l8Qd5FZjSvdKAHdOSky3cQ TDJA== X-Gm-Message-State: ALQs6tAMjdTUDUTIqBoFKuM2gp4MDRBZeHd5ISOqxFS1gVR/YBaRg92S MzDA2ZvdFYma+IJy+iKqW/81aJFd6NF07h04SYp6l1mN X-Received: by 2002:a9d:11f4:: with SMTP id y49-v6mr12854384oty.163.1525208823488; Tue, 01 May 2018 14:07:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:185:0:0:0:0:0 with HTTP; Tue, 1 May 2018 14:07:03 -0700 (PDT) In-Reply-To: References: From: Ulf Magnusson Date: Tue, 1 May 2018 23:07:03 +0200 Message-ID: Subject: Re: [ANNOUNCE] Kconfiglib menuconfig implementation To: Randy Dunlap Cc: Linux Kbuild mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 1, 2018 at 9:47 PM, Ulf Magnusson wrote: > On Tue, May 1, 2018 at 9:12 PM, Ulf Magnusson wrote= : >> On Tue, May 1, 2018 at 7:56 PM, Randy Dunlap wro= te: >>> On 04/30/2018 05:57 PM, Ulf Magnusson wrote: >>>> Hello, >>>> >>>> Kconfiglib (https://github.com/ulfalizer/Kconfiglib) now has a >>>> terminal menuconfig implementation, implemented in plain curses >>>> (which is in the Python standard library). >>>> >>>> The interface should feel familiar to people used to mconf. It has >>>> some features that mconf lacks: >>>> >>>> - Seamless resizing >>>> >>>> - Unicode support >>>> >>>> - Runs on Windows (via 'pip install windows-curses', which uses >>>> PDCurses) >>>> >>>> - Improved information displays: >>>> >>>> * All expressions are split into readable chunks >>>> >>>> * Menus and comments have information displays >>>> >>>> - Relatively easy-to-read and easy-to-tweak code. >>>> >>>> Kconfiglib automatically invalidates symbols as needed, and >>>> values can never get stale, which helps. >>>> >>>> Some upcoming features are mouse support and a search feature that >>>> can jump directly to the definition of a symbol. The jump-to feature >>>> will use a "show-all" mode in case the symbol isn't visible. >>>> >>>> See the Kconfiglib GitHub page for screenshots. The menuconfig >>>> implementation is at >>>> https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py. >>>> The docstring at the top has some more information. >>> >>> Hi, >>> >>> I'm probably missing some python additive (I hope it's that easy), but >>> menuconfig.py is not liking the "degree" symbol in drivers/net/can/peak= _canfd/Kconfig: >>> >>> config CAN_PEAK_PCIEFD >>> depends on PCI >>> tristate "PEAK-System PCAN-PCIe FD cards" >>> ---help--- >>> This driver adds support for the PEAK-System PCI Express FD >>> CAN-FD cards family. >>> These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as wel= l as >>> CAN-FD access to the CAN bus. Besides the nominal bitrate of = up to >>> 1 Mbit/s, the data bytes of CAN-FD frames can be transmitted = with >>> up to 12 Mbit/s. A galvanic isolation of the CAN ports protec= ts the >>> electronics of the card and the respective computer against >>> disturbances of up to 500 Volts. The PCAN-PCI Express FD can = be >>> operated with ambient temperatures in a range of -40 to +85 = =C2=B0C. >>> >>> >>> kconfiglib.KconfigSyntaxError: >>> Malformed ascii in drivers/net/can/peak_canfd/Kconfig >>> Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n' >>> Problematic data: b'\xc2' >>> Reason: ordinal not in range(128) >>> >>> >>> thanks, >>> -- >>> ~Randy >> >> Thanks for trying it out! >> >> You're probably running in the C locale, which implies an ASCII >> encoding. That has caused enough trouble that the Python devs decided >> to automatically convert it to UTF-8 in Python 3.7: >> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=3DC.UTF-8 should fix >> it. >> >> It's a bit silly to have it crash for something like that though. I >> could force UTF-8 instead of respecting the locale (though it feels >> neater to respect settings), or tell Python to ignore decoding errors. >> Should probably do something at least... >> >> Cheers, >> Ulf > > Leaning towards just forcing UTF-8. It's what you want in 99% of > cases, and ignoring decoding errors would be unsafe for Unicode string > values. > > Could make the forcing optional, and default to on... > > Cheers, > Ulf Went with a more general solution: https://github.com/ulfalizer/Kconfiglib/commit/da40c014398f329b324a2eb9de06= 2344e773dc74 You can now specify any encoding (or None, to use the encoding specified in the environment), with "utf-8" as the default. That default probably saves a bunch of pain in practice. Cheers, Ulf