From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2NSlKpzvLGXowwAAG6o9tA:P1 (envelope-from ) for ; Mon, 16 Oct 2023 10:09:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2NSlKpzvLGXowwAAG6o9tA (envelope-from ) for ; Mon, 16 Oct 2023 10:09:00 +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 70B5B3EB04 for ; Mon, 16 Oct 2023 10:09:00 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kRcSpwfC; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697443740; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pzV451c9qXixbN4qpC2XL3qFls8d59n+Tvicwx86z+4=; b=A0CcG0OcvF1BiRROuETUOmiqj7CDuMw0dXpTOJPoIZ40dq8PK/FQad/CG1MvYfEagRlejg U/ZiceZPbEdd860S88VgcTalgj5Ky+6N6OJ5qHujthQpQq20GJz8TAi7z6RvcxQmpOHzXj 059++xVZ2Iwl6Uegg0EKQqLSAvSBJxRVcHBnG+kd6Gtzk3Sfpy06+qnvtDaurUGj2XKBGL dni6WFEYTIInZrAmJeOrxF/qKCxg8EeoBJMKYphMx0QUZyxiujP7TT/5ZZ8OxcOJuAu2uA JGilvhSJGg2tdLOatRFK/RolCe44Jj17749ZoJh1V53W7Q4BwGNocaJDyeHAhA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kRcSpwfC; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697443740; a=rsa-sha256; cv=none; b=kYyrX4U8EE5IWHwDbmHLpciCobY/5WPXlGFL3gkKzyV9oPcLpE6R/lY8/5+0j96sWdM/I3 TbzEbm/BrRrYZp5feiBeJwVNiXNGMo/nr4dfZLVWCtqqoGdFGius/1nWJcEARa++OcHBhB 1GaXLuERpsmX4eA1/+hEx1At9iH28vpIhnU0KIWnj52adD8D8rY1hMcHDIB6Zhx2rnDMUu M9O3MmBSV/4oHny94Sv7qRVAKcvWU3yPb/p0cbP9QSD1tnhjGvBchpqo8UgzyNmm57dxgM YTs64I/swUDxQFWHqZ+APjiNrdph8jkBwivrXMAnaMO7GANBgaUNjt1mxe92aw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qsIdq-0001Ym-3q; Mon, 16 Oct 2023 04:07:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsIdj-0001YU-EQ for emacs-orgmode@gnu.org; Mon, 16 Oct 2023 04:07:52 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsIdh-0003hr-51 for emacs-orgmode@gnu.org; Mon, 16 Oct 2023 04:07:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A22ED240105 for ; Mon, 16 Oct 2023 10:07:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1697443664; bh=3f3UgZPXCU3I7DAe3PS13Q/WNnz4wBONCA6RfiELMoM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=kRcSpwfCVYNIGKhdVUdJi8zt8VPqlVDXcBpnpzLima0n+qU1SaWrQB4VLaXXqQcJN k7lDpFwCHt1dqk3wCWhV8gR3eC+UtNxdGcOfkd2QLQ+2xjO/IkbxX4LaOtbYrZhBsQ qG8UYlYacgeyjzZ0/H7Z+fE6WFuVXZ2Cpq2YnC/Wt/Kv6NjFVxgaw6XLOodwuQxlZf zAPGYnnhE+dQcsmhX6EjQ6hakGSyMUhtMY0/bSdDAAfIxbl/qcy44wLSy0P9supltd RIZkT0CpDEjHURopdg31/BtqZbzApHBeuVEctn8UwZRmCFRl1cM+NyHQeuZdB2xW21 BSek9OlkCkvUg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S88qN1gDYz6txm; Mon, 16 Oct 2023 10:07:44 +0200 (CEST) From: Ihor Radchenko To: Jack Kamm Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] FAILED test-ob-python/session-multiline In-Reply-To: <87edhvign0.fsf@gmail.com> References: <873506j7ky.fsf@localhost> <87il91ajq7.fsf@gmail.com> <87ledxix4l.fsf@localhost> <87fs449xoy.fsf@gmail.com> <87edjn4lfr.fsf@localhost> <87edhvign0.fsf@gmail.com> Date: Mon, 16 Oct 2023 08:09:30 +0000 Message-ID: <874jir9ef9.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.68 X-Spam-Score: -6.68 X-Migadu-Queue-Id: 70B5B3EB04 X-Migadu-Scanner: mx2.migadu.com X-TUID: nfFK86pTUMdW Jack Kamm writes: >> If we can (eventually) remove some custom code from Org and move it to >> Emacs, it will be the best for working towards RMS request >> https://orgmode.org/list/E1kIPh1-0001Lu-Rg@fencepost.gnu.org > > I started down this path here: > > https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00004.html > > But I haven't followed up because I started to have some doubts. In > particular, `python-shell-send-string-no-output' will terminate once it > detects a prompt, so if some output looks like it ends in a prompt then > it will terminate prematurely. Whereas in our current indicator-based > approach, the user accidentally emitting > `org-babel-python-eoe-indicator' is unlikely. This problem is not new - it exist in comint.el itself. I worked around it in ob-shell by re-defining prompt to be unique - see `org-babel-shell-set-prompt-commands'. Of course, it is not a universal solution. > Another approach I have considered is to redirect sys.stdout from within > Python. In particular, set it to a custom class inheriting from IOBase > during the block's execution, that both prints and saves the output. I > think this approach could ultimately be more robust, and without needing > to print an ugly indicator token, but it could be complicated to do it > right. It may work, although it will affect certain workflows. I know that some people use a mix of babel session blocks and manual comint buffer interaction where they type commands manually. Hiding the output may not be ideal in such scenario. That said, the described scenario is somewhat buggy already. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at