emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Sam Crawford <sam@crawf.uk>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: [BUG] Org babel python async can't return values
Date: Wed, 26 Jun 2024 13:01:26 +0000	[thread overview]
Message-ID: <87pls3kgd5.fsf@localhost> (raw)
In-Reply-To: <h6c_ta-utc-ugGl4Bq1XXJpXcpXlm_rblFIGJKMH0xiPc-NnJsuVe2z8atXGNcsBlJiR9c24bqLyXFX3GO0tiWtyTUzXMJA81wRIIB-DQfo=@crawf.uk>

Sam Crawford <sam@crawf.uk> writes:

> A MWE is:
>
> #+begin_src python :async yes :results value :session python
>   12
> #+end_src
> ...
> 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?

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=498fd25d2

At least, I did make the regexp stricter. Please let me know if you are
still seeing problems.

-- 
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>


      reply	other threads:[~2024-06-26 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 10:14 [BUG] Org babel python async can't return values Sam Crawford
2024-06-26 13:01 ` Ihor Radchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pls3kgd5.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=sam@crawf.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).