Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id BDF44431FC0 for ; Tue, 11 Feb 2014 06:14:57 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e1dJWmdliq9i for ; Tue, 11 Feb 2014 06:14:51 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id A06BC431FBD for ; Tue, 11 Feb 2014 06:14:51 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 718A21000FA; Tue, 11 Feb 2014 16:14:45 +0200 (EET) From: Tomi Ollila To: David Bremner , "W. Trevor King" , notmuch@notmuchmail.org Subject: Re: [PATCH v2 14/20] nmbug-status: Encode output using the user's locale In-Reply-To: <87eh396e6e.fsf@zancas.localnet> References: <87eh396e6e.fsf@zancas.localnet> User-Agent: Notmuch/0.17+69~g761b031 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2014 14:14:57 -0000 On Tue, Feb 11 2014, David Bremner wrote: > "W. Trevor King" writes: > >> Instead of always writing UTF-8, allow the user to configure the >> output encoding using their locale. This is useful for previewing >> output in the terminal, for poor souls that don't use UTF-8 locales >> ;). > > This (or some other patch in the series) seems to cause some problems on > the production instance: > > remote: Traceback (most recent call last): > remote: File "/home/nmbug/tools/nmbug-status", line 336, in > remote: page.write(database=db, views=config['views']) > remote: File "/home/nmbug/tools/nmbug-status", line 96, in write > remote: self._write_view(database=database, view=view, stream=stream) > remote: File "/home/nmbug/tools/nmbug-status", line 115, in _write_view > remote: self._write_threads(threads=threads, stream=stream) > remote: File "/home/nmbug/tools/nmbug-status", line 219, in _write_threads > remote: ).format(**message_display_data)) > remote: File "/usr/lib/python2.6/codecs.py", line 351, in write > remote: data, consumed = self.encode(object, self.errors) > remote: UnicodeEncodeError: 'ascii' codec can't encode character u'\u017b' in position 219: ordinal not in range(128) > > possibly because of > > LANG=C > LANGUAGE= > LC_CTYPE="C" > LC_NUMERIC="C" > LC_TIME="C" > LC_COLLATE="C" > LC_MONETARY="C" > LC_MESSAGES="C" > LC_PAPER="C" > LC_NAME="C" > LC_ADDRESS="C" > LC_TELEPHONE="C" > LC_MEASUREMENT="C" > LC_IDENTIFICATION="C" > LC_ALL=C > > I think it's fine to _allow_ the user to configure the output encoding. I'm > less sure about _requiring_ it. That reminded me that yesterday (after review, of course) I thought that we probably want configuration file to be parsed as utf-8 instead of any encoding user may have in their system... > d Tomi