From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 3A6594048F5 for ; Sun, 14 Mar 2010 12:01:34 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.866 X-Spam-Level: X-Spam-Status: No, score=-0.866 tagged_above=-999 required=5 tests=[AWL=-0.867, BAYES_50=0.001] autolearn=ham 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 ivMi0VwZ6W3y for ; Sun, 14 Mar 2010 12:01:33 -0700 (PDT) Received: from jameswestby.net (jameswestby.net [89.145.97.141]) by olra.theworths.org (Postfix) with ESMTP id 34A3A454968 for ; Sun, 14 Mar 2010 12:01:33 -0700 (PDT) Received: from [74.220.175.184] (helo=flash) by jameswestby.net with esmtpa (Exim 4.69) (envelope-from ) id 1Nqt47-00048z-BI; Sun, 14 Mar 2010 19:01:31 +0000 Received: by flash (Postfix, from userid 1000) id B3699605C14; Sun, 14 Mar 2010 15:01:28 -0400 (EDT) From: James Westby To: Michal Sojka , notmuch@notmuchmail.org In-Reply-To: <1268590751-7478-1-git-send-email-sojkam1@fel.cvut.cz> References: <87mxyabwha.fsf@steelpick.localdomain> <1268590751-7478-1-git-send-email-sojkam1@fel.cvut.cz> Date: Sun, 14 Mar 2010 15:01:28 -0400 Message-ID: <87ociqbud3.fsf@jameswestby.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [PATCH] Produce valid JSON output even if mail body is empty 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: Sun, 14 Mar 2010 19:01:34 -0000 On Sun, 14 Mar 2010 19:19:11 +0100, Michal Sojka wrote: > Mails with empty body produced the following output: > "body": [{"id": 1, "content-type": "text/plain", "content": (null)}] > The (null) is not valid JSON syntax. Is this just something that can happen with the body? I've see (null) in the emacs interface when I've done something silly such as opening a newer notmuch db with an old client. Should all the attributes be guarded in a similar manner to ensure valid JSON? Thanks, James