From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp0.migadu.com ([2001:41d0:403:58f0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms8.migadu.com with LMTPS
	id ALjDCzaxu2UeYAEAqHPOHw:P1
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 01 Feb 2024 15:56:54 +0100
Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp0.migadu.com with LMTPS
	id ALjDCzaxu2UeYAEAqHPOHw
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Thu, 01 Feb 2024 15:56:54 +0100
X-Envelope-To: larch@yhetil.org
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20230601 header.b=jcsxqsE7;
	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=gmail.com
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1706799414;
	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:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=0QmxCBd0WrUzSp4DquHl5/f9iTRGKyOiG79wOhavUvU=;
	b=fxbpWvgh3HaJ9bD6DxfH7NaK+chLtzYuT6rX6ForrtRcdNo1alitC/IQm66SAis85wzVwu
	F6thg78y8+i0qxmz+XW7FLi1RY1b3IpQOHUDvuFdYlex+g4/Bn6HI8sWwfsWhkCOLxdIm9
	vj3BjllcFyqx+VxPTp4rKHHvMrIj/g6jn3JJwygRefJTMRj0Fi58NSvFH3Sb5AidROgDob
	R9yC6q6DHrpDPv0xYv0S4FYAWnH2Fsua3VCWnGVumybFa7v8esVHt4c/MBcDzh8L2zqFWx
	dya52b7o3vl19VO+5JG534Afolf6xQFdXchchEk5L8aWYcH6Srsh3OsBXAh2gA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20230601 header.b=jcsxqsE7;
	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=gmail.com
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706799414; a=rsa-sha256; cv=none;
	b=ojlk+1HZEiKBzooOOCa+j/wsnBTl7eFjKYGiq9QcHbh5cKDl31K/yhS99xBAXws10JDLQS
	NP2XPgiMSzQNWpbG9FSc4DP4wu2P9opm7QMrlTsxamh6k0H6XDEsK40kaujb48wP0jxoRu
	+LU5vYkfxh7KEY6NemoCumytiNyUgqk3kKfzpVug1GyvABnT5UxXvvNp6q6IdAo9dRzDsf
	OBOkOeQ2b+dxtDkFLqJhxWFYFD8pn30SumbHjrylzssL42B7afvImlx/SfSo5I3cTXtXfq
	QfQolyh4e8+OZq6/JvMwkDY83somr8/cDqfmLjNwXHXShenOW0rAJczTIZiSAw==
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 0FAA76C46C
	for <larch@yhetil.org>; Thu,  1 Feb 2024 15:56:54 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1rVYUE-0001Ls-2P; Thu, 01 Feb 2024 09:56:18 -0500
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 <brubar.cs@gmail.com>)
 id 1rVYUA-0001LT-7U
 for emacs-orgmode@gnu.org; Thu, 01 Feb 2024 09:56:14 -0500
Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <brubar.cs@gmail.com>)
 id 1rVYU7-0001Be-QH
 for emacs-orgmode@gnu.org; Thu, 01 Feb 2024 09:56:14 -0500
Received: by mail-wm1-x329.google.com with SMTP id
 5b1f17b1804b1-40ee9e21f89so8747525e9.0
 for <emacs-orgmode@gnu.org>; Thu, 01 Feb 2024 06:56:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1706799369; x=1707404169; darn=gnu.org;
 h=mime-version:date:references:in-reply-to:subject:to:from:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=0QmxCBd0WrUzSp4DquHl5/f9iTRGKyOiG79wOhavUvU=;
 b=jcsxqsE7Qw7XbzctXr1pAEeeLljQjGb6kmml7KsRrwQmy8aKSVb4Eiuv4+sr/v4E2v
 X2d42TqMpZBg6CXlVPmDzRwUokyiCdPIXwF6Qf9GLcGy5JQR0ZF5RVvM04Vdfi71fKHl
 2KqLNTA2RDGytuaSlREtisZYtt26EkSc/BlIz+ogZ/pdTtF2O+/LwXY31aBN+tklGGA7
 QfiYBjlFaIs8Cc5vbnCyKEoZ/pF4lt4Iag5dFIOqPGA6bE0MjoVWLLJLHHXYGRaGfRda
 apzCsv/Mf1ZOiXSo7kzXx7ToLvYnFmVf0dzG+UnsD1GUe5vPk0vN0x23hF+tBVZ1BXWb
 iTug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1706799369; x=1707404169;
 h=mime-version:date:references:in-reply-to:subject:to:from:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=0QmxCBd0WrUzSp4DquHl5/f9iTRGKyOiG79wOhavUvU=;
 b=Uy/a6XLr9RTTR/HldrjPgUvilaMMi1oRES/+O805ZCGSgqkCJNY7zf/q7jx2RxqAaU
 D2RVxM/OZLIPV/VjQM9jNm0f+4b433Bsw6qdrvQKkBd1yA6nKAuHU1fC4C1RZEDC1uuW
 yarRsX2YdeBMMKTunxenwK0Suq+/o5OXJmwHHUezK3Xqi/ib+B5K6RiUlvAbCGu0eKgj
 gl6or0k1/t6omxrlD3CiavTZ8pLpmauRe5jU9zmsar5YPmeQfrZxj9m2jioSvt+LDyS4
 C5rY6VJrAFeQdanyX+tbseJKZc4EgjShPNMNw1oybnrWxpQKHDG2oCbw6K0q2UqgjYC+
 U7jw==
X-Gm-Message-State: AOJu0YxVJG2qcYcJnOrhDukIgfdtmz53Cn43bH8iClgGX8ubVLvjoIIR
 6Bwtq0biXwF5HjA+2bX4Epy4+oCYCN08q6EJQaOhRhw1auhYLP89
X-Google-Smtp-Source: AGHT+IHKby4x1CNrvV3WpL6J8AZQpfCSysR5IykcGGnTqOukX+R/iu75bZWlM21HfYRlS8BrdtNIrA==
X-Received: by 2002:a05:600c:3c96:b0:40f:afcd:7558 with SMTP id
 bg22-20020a05600c3c9600b0040fafcd7558mr2054866wmb.24.1706799369002; 
 Thu, 01 Feb 2024 06:56:09 -0800 (PST)
X-Forwarded-Encrypted: i=0;
 AJvYcCUOP87VdCjaCkTK6cwE98JR35QT+gwd0D78Z4lf/i+adpmsipeuLwY5sUxji5rvPlN+FQ1Dzs8YigKdElyYZqscsWPD5nASffNDODlLUNdO7F5tq8B+cKmL9g==
Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e])
 by smtp.gmail.com with ESMTPSA id
 r17-20020a05600c459100b0040e527602c8sm4710588wmo.9.2024.02.01.06.56.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Feb 2024 06:56:08 -0800 (PST)
Message-ID: <65bbb108.050a0220.b60fd.6790@mx.google.com>
Received: by keynux (sSMTP sendmail emulation); Thu, 01 Feb 2024 15:56:07 +0100
From: Bruno Barbier <brubar.cs@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>, emacs-orgmode@gnu.org, Jack Kamm
 <jackkamm@gmail.com>
Subject: Re: [BUG] Unexpected result when evaluating python src block
 asynchronously [9.7-pre (release_9.6.17-1131-gc9ed03.dirty @
 /home/yantar92/.emacs.d/straight/build/org/)]
In-Reply-To: <87o7d0mm54.fsf@localhost>
References: <87o7d0mm54.fsf@localhost>
Date: Thu, 01 Feb 2024 15:56:07 +0100
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::329;
 envelope-from=brubar.cs@gmail.com; helo=mail-wm1-x329.google.com
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,
 MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=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-Spam-Score: -9.96
X-Migadu-Queue-Id: 0FAA76C46C
X-Spam-Score: -9.96
X-Migadu-Scanner: mx11.migadu.com
X-TUID: S53WMKQW82eJ


Hi Ihor,

Ihor Radchenko <yantar92@posteo.net> writes:

>
> This is most likely something about my current system setup - I can
> reproduce with other Org mode and Emacs versions. But I have no clue
> what is the cause.

I'm getting the same as you with your MWE.
   
The tag, used by ob-comint async, is:

   "/tmp/babel-zqh04P/python-GL5N5d"
   
but, in "/tmp/bug.org" it becomes:

   "babel-zqh04P/python-GL5N5d"

(`org-babel-result-to-file' transformed it into a simpler relative
path).

The filter `org-babel-comint-async-filter' cannot spot it, because
it's searching for the exact string "/tmp/babel-zqh04P/python-tXsdFw".

Here is how to reproduce:
   #+begin_src elisp :results table
     (let* ((tag "/tmp/babel-zqh04P/python-tXsdFw")
            (repro 
             (lambda (fn)
               (let ((lnk 
                      (with-temp-buffer
                        (org-mode)
                        (let* ((default-directory "/tmp")
                               (buffer-file-name  fn)
                               (cbuf (clone-indirect-buffer "tmp" nil)))
                          (with-current-buffer cbuf
                            (org-babel-result-to-file tag))))))
                 (list fn
                       (not (eq nil (string-match-p (regexp-quote tag) lnk)))
                       lnk)))))
       (cons (list "Filename" "string-match-p" "Org link")
             (cons 'hline
                   (mapcar repro (list "/tmp/bug.org" 
                                       "/somewhere/else/bug.org")))))
   #+end_src

   #+RESULTS:
   | Filename                | match-p | Org link                                      |
   |-------------------------+---------+-----------------------------------------------|
   | /tmp/bug.org            | nil     | [[file:babel-zqh04P/python-tXsdFw]]           |
   | /somewhere/else/bug.org | t       | [[file:../../tmp/babel-zqh04P/python-tXsdFw]] |


I don't know what a proper fix would be though.
   
Hoping this help,

Bruno


>
> Emacs  : GNU Emacs 30.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.39, cairo version 1.18.0)
>  of 2024-01-30
> Package: Org mode version 9.7-pre (release_9.6.17-1131-gc9ed03.dirty @ /home/yantar92/.emacs.d/straight/build/org/)
> -- 
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>