From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id OHeIMT75e2bCZwEA62LTzQ:P1 (envelope-from ) for ; Wed, 26 Jun 2024 11:19:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id OHeIMT75e2bCZwEA62LTzQ (envelope-from ) for ; Wed, 26 Jun 2024 13:19:26 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=crawf.uk header.s=protonmail2 header.b=cOzKehkP; dmarc=pass (policy=none) header.from=crawf.uk; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1719400766; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=k+vR4LF0d40BJVlJcLM/4S8d/nmky/ORBRSYYqfOUdk=; b=VSsp5tPD9UplrVni7UBSLH98ZrubMrnvIBhKKlypkqTrzpYMJ96DEE+ayRymL5XzVDcPEi JGACOicMHK8pQFLk5floxeic8FOdQ4Zfs0FS6oNZhfecGMWU5C/BWezf7jDlK18d8gbnMS KFlfOlF2gKkUkEJAaf4zIiowIMsbO/J2PTaeNFozZ1nMEILiXRCSlCjIbXwnxA1MlwsrYo KNWM3u/XsJtzqeOC8noSJ+Wt89+GV18/ad4KjgKIHNI9I9vkq+UunlLZz0giQqvLeD18C6 PuY6kLVw9Ld7m8NT2hx+BgdEq44vf7oE28ZYYtoIYh4FrJQUoqYaCbw8OyTi2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1719400766; a=rsa-sha256; cv=none; b=M6HR0ldnSMes8RWeYU8cje88SychlZcM0ncqB5bxmu2OExGoM/xrQqGnrVXGv+KxIS1w5/ +zU6/FO6I+beTfacRCLuizCRQgshD6Ltte4Vey16k7wt3PexBEQheyMgpoa/jL3+iwmx69 3ka72rMfmOpCIkwBwykshduAfNA74L9or2SsVLZA6B1/JHxh2iA2ARW6P/YXBhW5jrnqUc L6HmHDiomBjSX3ZpUSsI1V9Y6gPlYAu0KvnHwCTj6V1/g1IMcid7DYfXv+Ccp6JfuIYBzw wX2/vvCislAQj1eeOEOm0dgVGQCLRqLkgEbI/A/l+oCgtw3OP2S6uJ0imTdTEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=crawf.uk header.s=protonmail2 header.b=cOzKehkP; dmarc=pass (policy=none) header.from=crawf.uk; 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" 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 657A7311D8 for ; Wed, 26 Jun 2024 13:19:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMQfI-0002G2-Sl; Wed, 26 Jun 2024 07:18:16 -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 1sM3Cj-0005Wq-Cu for emacs-orgmode@gnu.org; Tue, 25 Jun 2024 06:15:13 -0400 Received: from mail-4018.proton.ch ([185.70.40.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sM3Cd-00080k-Hi for emacs-orgmode@gnu.org; Tue, 25 Jun 2024 06:15:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawf.uk; s=protonmail2; t=1719310504; x=1719569704; bh=k+vR4LF0d40BJVlJcLM/4S8d/nmky/ORBRSYYqfOUdk=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=cOzKehkPrxCN8lka1Jij0OOKg9Ui9I42/WFx3LRNvvNWLOC6OJAZeydj2QCeMjLp+ Em5kUEdmvE8iRoeCHqBDbnYhW4hcVTVSQBW6HrwA1IngfRv2mzb1x4une/iWTaszdG h/gtQm4JwC1NfiDSF7v9QTXd4bdCJa2e6JHpPMSJ4PRm6hEk6GBNQCy2raEYQDfs8G YY1pqlHlJrmmwSfjuPaPwHhCi8wgAYo0nJ3pv5S8wd0neu8FP1VnZCSLGaZhIro8bq CCIYhv83yimonHwo06JaD6vrKlf6TOBBin6jlcFrFhrI6GGTxmGsrdXQbbflecTM8/ XV41AWPKpCl5g== Date: Tue, 25 Jun 2024 10:14:59 +0000 To: "emacs-orgmode@gnu.org" From: Sam Crawford Subject: [BUG] Org babel python async can't return values Message-ID: Feedback-ID: 80966066:user:proton X-Pm-Message-ID: 1012b3d347dc1b033da2ffe69981f698c2bb702a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.18; envelope-from=sam@crawf.uk; helo=mail-4018.proton.ch 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 26 Jun 2024 07:18:14 -0400 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 657A7311D8 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.56 X-Spam-Score: -6.56 X-TUID: 5cJFhQ5apemr This may be MacOS specific, but I noticed that :async yes only works with :results output; :results value never returns. A MWE is: #+begin_src python :async yes :results value :session python =C2=A0 12 #+end_src This ought to return 12, but the "#+RESULTS:" field only ever shows the value of the temp file I believe the issue comes from the regexp used for org-babel-comint-async-indicator on line 540 of ob-ipython.el. It is currently "ob_comint_async_python_\\(.+\\)_\\(.+\\)", which means that, if the temp file's path contains underscores (this is the bit I believe is MacOS specific), the regex will greedily consume those underscores, and (match-string 1) will fail to identify what type of results we have. I'm not too familiar with the code but, given that the first group seems to only ever be a simple word, perhaps the replacing this regexp with "ob_comint_async_python_\\(\\w+\\)_\\(.+\\)" would be sufficient?