From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GB8CF/yaRmORGwEAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 12:46:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QDHwFvyaRmM2UAEAauVa8A (envelope-from ) for ; Wed, 12 Oct 2022 12:46:20 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A9A6FF04D for ; Wed, 12 Oct 2022 12:46:19 +0200 (CEST) Received: from localhost ([::1]:38814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiZFi-0000Ho-RV for larch@yhetil.org; Wed, 12 Oct 2022 06:46:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiZDY-0000HQ-Tz for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 06:44:05 -0400 Received: from mail.hostpark.net ([212.243.197.30]:50122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiZDJ-0007V2-8c for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 06:44:04 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id D07D5165A6 for ; Wed, 12 Oct 2022 12:43:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-type:content-type:mime-version:message-id:date:date :subject:subject:from:from:received:received; s=sel2011a; t= 1665571422; bh=z1s8N41rtR6ifT50uAJyvIfdymuw7Y4JN4xIrduFfFw=; b=a 7HiDYwHf8LJkxaFFSRsZZdvmX9EfJRAkFAhMBk7jlKZxhv6KGF5Clet+LQtpNBdJ WUy9Y0MRU/e0J3P9xjCMooUuZCvmTYFJNTqfswrEQXkZL6XbgU4NwpcH834ojtQi 2WcQKvEkZcqX5dGoNRsX/KcNQL1qq15ByI1vRX5JrQ= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id 387um4I48mUC for ; Wed, 12 Oct 2022 12:43:42 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id A7B5716586 for ; Wed, 12 Oct 2022 12:43:42 +0200 (CEST) From: Jonas Bernoulli To: emacs-orgmode@gnu.org Subject: [BUG] org-babel-script-escape mishandled empty python list Date: Wed, 12 Oct 2022 12:43:42 +0200 Message-ID: <87v8opfhk1.fsf@bernoul.li> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=212.243.197.30; envelope-from=jonas@bernoul.li; helo=mail.hostpark.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665571580; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rdtUdrOcTlxzEcO29Jzew+kwF5rdXD389UpL6NREzUM=; b=N7DCFnkZeahBCFLezqT8ARyQBK+ZocQBFC66ealymQBIZTy5WmwIYvPv1Ff5LyceAu6RFc vDsBpMw5eD1cEl/gKjOyyWaamVpuQ5hTAqZvKp2JFCX88PG5lD1LZfUj2KrROoIDitSGsA GG3TvQU91MSbYVH/9k1WmEeXN/GD6BQw+OXv6iVAQX60T+3Big5Na9nj4K1eKSFgNDlTnT 8w+/Qy86wfkDvaLtgmA/BHjm5c5gIR9KoYh5RihGIpeHj8smmG53UBZeOipF7hZ+qiPPKo 4Ibgkhi/PfZP3IH6UIdHYjlIxCb56c3+KhqfyCKmr4jf0jiGBI6/9V1TuHMACA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665571580; a=rsa-sha256; cv=none; b=BYFcV/PaJiNe0t4geqq8YKnAGw0ZOxnzcbsRP9kaRrRdxewmb40FBTM5CbPOHWjQl3Sqr9 KTdLzQ3g+gdBgZwngk5tmCEArlPMsq7RikZQkkN12Ch2uBNKSXm/Azok2cQiqM9ksH29J5 pNtyAbAfHilP+w1+1jxvu0d7D/iiD/5BRqOQEd+ayjwTPKPe7v7wi3mJ9P+vAwLHQuKMkC gZfKnkUvVlPaGmeK05tRKqT7UnAri9sXKps5GZt9lavshHsC1ooOcjL8dSLcK2g+gdxALP oYQl/kHIyXc6VO2NzXHi05OYJplsiNzwsg1hb3E/TA+m4C+QQ+AjnmoOxnLuHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b="a 7HiDYw"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b="a 7HiDYw"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: A9A6FF04D X-Spam-Score: -3.50 X-Migadu-Scanner: scn1.migadu.com X-TUID: OOgLyHnyKVMK `org-babel-script-escape' doesn't handle an empty python list correctly; ['a'] => ("a") but [] => []. #+name: addheader #+header: :var rows="" #+begin_src python return [] #+end_src #+header: :post addheader(*this*) #+begin_src emacs-lisp :results table nil #+end_src #+RESULTS: : [] An empty python list is turned into an empty lisp vector instead of an empty lisp list. At least for python, (> (length str) 2) should probably be changed to use >=.