Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4688735imm; Mon, 14 May 2018 11:12:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq0e2dJLDqGrD4SFbkTxtSDsguDfpyGpDl5Qa21jkmOl01zKDWwJY9peE2WtWgOCF7PnBbJ X-Received: by 2002:a17:902:e85:: with SMTP id 5-v6mr4943679plx.318.1526321570778; Mon, 14 May 2018 11:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526321570; cv=none; d=google.com; s=arc-20160816; b=kPqMtQRCzUr7Bq7vvNv0kVDCKzECGYjkW3zN9LKBtSuq8KdOX+RQIsfMHSAAsyX9rx Vlvcz1PMJPu8L2df/qinQbWYQLXctskrd9ZenYtngQ8S7sH0TvyMiwS3mZqcnVTQdnBd u5ZS7iRlnwCtqV7g6OavlQl05fCIR8NUZFoq/t/UshwRtKEW/6o+ep0sBPr5O+Jvy6gd aBuXP7k9yguEx7ghqPLpyBc4I0oepKJ+pWNKcYkgjNE1fL9JdTg6OKpK+aJxmo8dOU+N T6BONrDf+xASgDJHpw9FD7aBqig40tM93qSagOzT1ak1+Kz3ofZkFuJwOlNaJkcpohcQ l7OA== 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=AAbE44ndukCmEW4UhjtIEXdGIjsH6SwY774cM36rtc4=; b=sQQlZntgaihvRDdDKBwTYJtEBJfgJrh1DBn0e7g9EFfcRB8+/sv9BSm2TELhUCC8CU 5w+eM6ug01ZOYTiZkvhjOmuK11CF2keaxpefHHGmAwSMtumh7D1lA7gWJcVDVg2xjlKh 8Kl2jADhZJcDiauLUt6HkFsGXr2tBVwHVACb1jUr3rNyvi9Q6LGx2qt3ClVRhCPYwOz/ kvJ/V38QHpCuL0WU6DUrNapCvoUjK68ruh6o4T/ju88GNGGvXdkMaugvQSGAdqeFQw3v D8BVIBHYJBGP9VJT9of0ugPF2CGvMMgaqmx+gc05/rx+AjhRNlzR+1gxODsVXd92uxPQ +OeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QW2VPYQW; 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 w64-v6si10246051pfw.201.2018.05.14.11.12.36; Mon, 14 May 2018 11:12:50 -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=QW2VPYQW; 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 S1752035AbeENSMY (ORCPT + 99 others); Mon, 14 May 2018 14:12:24 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:38377 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbeENSMX (ORCPT ); Mon, 14 May 2018 14:12:23 -0400 Received: by mail-ot0-f195.google.com with SMTP id n3-v6so15375087ota.5; Mon, 14 May 2018 11:12:22 -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=AAbE44ndukCmEW4UhjtIEXdGIjsH6SwY774cM36rtc4=; b=QW2VPYQWOtZ6eQPaKm/3hAOd2l+9zJq0oX8h0skyuux3HwhFf4FdNPyFwFzBQTMWHQ ++Qrz5eUdiJTItfh1bNOK8igNqtYvuH9eZWd49EIYPEkzfXpZcHFMsKeKzKf+iv/ROFc /Ttr4GO3DSfhCuu4EcNYf1Ng1DPlrqwABNUngTOfg5yArzOEu/WLr6EbLegU6idF17fg BK3cpmvprecfXPEotg0lS4+wkJ/KmW4pLNCmFwXInMGBtg308OVgBtwDlI3tySygUEf8 w5ecu/XJn7mIWLUfbsrS4Oa6q5pOraW/fp2EpK2FkDQyfSkABTFMJ3eDr6Yu9x1kwtE9 RADQ== 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=AAbE44ndukCmEW4UhjtIEXdGIjsH6SwY774cM36rtc4=; b=mlJRcd8FSxoiDNQS1WFBJgwtwvwEZq3MSz8S0g3cCzLlTncx7tKaRbLjOvJurBISRZ 6JcuZEeqfPSTU+drP3tgEuTH2E/3G2ElSYibyzvmKPaVh72QY9Ju7s4HqXIrQYB51ifZ YwHrrJaSSY9Y6NQP76C5RpHoV8X4DocLOVq7gCpR47/X5lPjNbu2KLwZ5A7/WgOw2s7+ +wS90W+ChJcXvRyxpigGz1MqeRXN2fStgnABZXmP4qB6mJL/D1pdQXZKrRN+whbV9uX6 K8T0v5XLhfNvto7+5w8gVi4leNSWBLxvhD1GfPQdf78K+nGtTmPebIKP8QfJKVxmTTlI MvRg== X-Gm-Message-State: ALKqPwcNoyVf5WbNgW+y4eBXk1DtTLLhi2qDVvAed8Q0kUJD4UfJV1t0 s9YX1OKwgbFKWOAK4J9VhCHORO9AhqwjpfsYJPY= X-Received: by 2002:a9d:de2:: with SMTP id 89-v6mr7684968ots.269.1526321542273; Mon, 14 May 2018 11:12:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:185:0:0:0:0:0 with HTTP; Mon, 14 May 2018 11:12:21 -0700 (PDT) In-Reply-To: <20180514165844.GD27984@xo-6d-61-c0.localdomain> References: <20180514165844.GD27984@xo-6d-61-c0.localdomain> From: Ulf Magnusson Date: Mon, 14 May 2018 20:12:21 +0200 Message-ID: Subject: Re: [ANNOUNCE] Kconfiglib menuconfig implementation To: Pavel Machek Cc: Randy Dunlap , 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 Mon, May 14, 2018 at 6:58 PM, Pavel Machek wrote: > Hi! > >> > 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 we= ll 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 prote= cts 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... > > Well, Kconfig files are utf-8, as is the rest of kernel. Yeah, it's the only sane assumption anyway. > > So yes, you should respect $LC_CTYPE for display etc, but you should alwa= ys > assume Kconfig files are utf-8... and that does not need to be optional. Already made it optional, with UTF-8 as the default (via Kconfig.__init__(..., encoding=3D"utf-8")). I did a similar thing to what PEP 538 does for the menuconfig: https://github.com/ulfalizer/Kconfiglib/blob/master/menuconfig.py#L2271. The C locale is converted to a UTF-8 locale for LC_CTYPE if possible. Other locales are respected. That'll be the default behavior in Python 3.7, and prevents issues with get_wch(). > > P= avel Cheers, Ulf