From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id M4B/GxqKyl6IEgAA0tVLHw (envelope-from ) for ; Sun, 24 May 2020 14:52:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id PgTYFhqKyl7mLwAAbx9fmQ (envelope-from ) for ; Sun, 24 May 2020 14:52:10 +0000 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 D62669400C3 for ; Sun, 24 May 2020 14:52:09 +0000 (UTC) Received: from localhost ([::1]:38312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcryx-0000HV-7j for larch@yhetil.org; Sun, 24 May 2020 10:52:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcryZ-0000H4-AN for emacs-orgmode@gnu.org; Sun, 24 May 2020 10:51:43 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:34397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jcryY-0002iR-Ii for emacs-orgmode@gnu.org; Sun, 24 May 2020 10:51:43 -0400 Received: by mail-pg1-x52a.google.com with SMTP id m1so1346751pgk.1 for ; Sun, 24 May 2020 07:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=g89hld+iRItIb9nlY5A0XjwbrCnkRQ4H/InYdxG4QTQ=; b=FXJRtstfvRWXyNHKYqJS3+tErtee4OVBQ5mezQz/MEWk8zuIwFGrO2Ay/kpE+wwoAt 3xl8RV9ZPzJFEoggFBYtjlUFrFQggvolluSx65usCPj/ef5V4E4/vt9c8iMlCtvzycD6 CSWDujqBh95Ab0Jf+vMSNFty4Tp7rgCyMEPuK8zL5Yp2QAtSSP56zHlJHvgkak7/DejR +lvj3qUyaugAVv4/BkNSrmUP/umvZQRERtNn3TpgxJ1oA6yPICQyybrC/cPCLytnFIwt vZjXVqYzDPHfMzHAGRJY6fSJHqzlzF2KjW/Me043xkkWJWescyXrqNvBcZJsTLqml7yw Qf2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=g89hld+iRItIb9nlY5A0XjwbrCnkRQ4H/InYdxG4QTQ=; b=p9miqE+JiDV/XJpE45lM/SxEhCFSNFySlNBAdYfJ3X/rFv/aBPw2gLTNartQ6C9Aix Sf6mK37wANtRwABsYBq4+v2b4a0Q7DUGn5JiCaCx3dg2uL4iF784kBfbDl9gB2NboRMV UaOyGDl6GByDPX43I4IxARDPEx+QVhe7dAv+P9+5tWQjuh1FzxyD9SwZlYcdtm3z9a2v 3DGCrRCgF+fSGNqgVsBVbr6rXQrTqYHntjYPvXG+tZGLPmr7MY/ojVsVIP8BrJdHF7LH Lj5yeUDK5OxwQWoe1Bs3JVg8UqGZ2OCMaNrPruJvXkZl+p1tCRShv9c0JQt4kO8w1ZOw 4/BQ== X-Gm-Message-State: AOAM531+AZlM6ZgIJZ7J72uMfL8BQG+Gox70WrD8rykiGzKQYInwZ0Lj Uq+2zIBsA7RIl4jJJk60R0E= X-Google-Smtp-Source: ABdhPJzEOJ2XfMy5Gill4a4sa7ksovOdnU4V2AcW8CF8H8N8Z27v1PTFeLdJIxy5U1yb0ZJ/nR+kCQ== X-Received: by 2002:a63:ab0b:: with SMTP id p11mr11970604pgf.278.1590331900880; Sun, 24 May 2020 07:51:40 -0700 (PDT) Received: from localhost (199-83-220-90.PUBLIC.monkeybrains.net. [199.83.220.90]) by smtp.gmail.com with ESMTPSA id m5sm10560952pjn.56.2020.05.24.07.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 07:51:40 -0700 (PDT) From: Jack Kamm To: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= , emacs-orgmode@gnu.org Subject: Re: Bug: ob-python mangles multiline :var values [9.3.6 (release_9.3.6-397-ga089600)] In-Reply-To: <87sgico0ne.fsf@gmail.com> References: <87sgico0ne.fsf@gmail.com> Date: Sun, 24 May 2020 07:51:39 -0700 Message-ID: <87a71xtmh0.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x52a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=FXJRtstf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: VK5jYX7ksCdc Hello, Thanks for reporting. I've just fixed this issue in master (commit 6149b6cb6). The problem was that ob-python adds tab indentation to the code body before putting it inside a main() function, which adds spurious indentation to multiline strings passed through :var. I fixed the issue by moving variable assignment from the code body to the code preamble, which is executed outside the main() function. Best, Jack =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec writes: > Recipe: > ------- > > emacs -Q > M-x load-library RET ob-python RET > M-x org-mode RET > > #+begin_src python :var text=3D"a\nb\nc" > return text > #+end_src > > #+RESULTS: > : a > : b > : c > > > Commentary: > ----------- > > ob-python seems to prepend a TAB character to every line except for the > first one. > > Emacs : GNU Emacs 28.0.50 (build 11, x86_64-pc-linux-gnu, GTK+ Version 3= .24.14, cairo version 1.17.3) > of 2020-03-11 > Package: Org mode version 9.3.6 (release_9.3.6-397-ga08960 @ /home/stepne= m/.emacs.d/lib/org/lisp/)