From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id tf/WCNOLCGOnSQAAbAwnHQ (envelope-from ) for ; Fri, 26 Aug 2022 11:01:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6GfvBtOLCGNuWAEAG6o9tA (envelope-from ) for ; Fri, 26 Aug 2022 11:01:07 +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 836223A82D for ; Fri, 26 Aug 2022 11:01:04 +0200 (CEST) Received: from localhost ([::1]:37618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRVD5-0002EW-3p for larch@yhetil.org; Fri, 26 Aug 2022 05:01:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRVBB-0002CL-Jw for emacs-orgmode@gnu.org; Fri, 26 Aug 2022 04:59:05 -0400 Received: from sonic311-30.consmr.mail.ir2.yahoo.com ([77.238.176.162]:33422) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRVB8-0005Ya-P6 for emacs-orgmode@gnu.org; Fri, 26 Aug 2022 04:59:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1661504337; bh=b0zyfg212IzOqNd2fGcMZwqTyY9bZQZWRyTgJdVw0/c=; h=From:Date:Subject:To:References:From:Subject:Reply-To; b=feG2/cprXcIQPLHirTmAyh7DoQVkGYMGyTJezZRjE8mqI04pH2OK3wMR4josQtSWz6Mk7R71HmFbQrPIP7gcQBXo8nUsHS+fOojqworfm1vaBAs84f+Gm8BZzbC777//zf77nXkYpDVUmqni88xBST/smogYfWoGBzNzpooh9DrIWYfPr11H7E5aBe7KREjjtIrRNAVZ8I15mrWg0B1upFwMS47/rTjVcKM1cGaroo6yn6BahFtmFupY7sQ8MaAuw71SitR9oScdmAE3AZOcur9KThsb2uabcB0ebYkuVVRrfXkIUrEZaRgESwmJ31NcxDejFP1tZG1s0HxRtv72+g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1661504337; bh=GIcF4vxfviZ1Y1uXduiMcCTp5pTWI7INsAA7LbAuQPf=; h=X-Sonic-MF:From:Date:Subject:To:From:Subject; b=TZIkDLOWV0iXrAgKu0NLXhyZJISAicwYJrA9YzZeOfEBezupP651qElT72odpjuwGDLOjwaREEfVjhWmaKZsDujbrwsibwSugZlDxry7OKXquPbo+82YVysdwwm3WN2zqj1w35P9uw3ycgh1fSoVEFyH3zQ5ef+X/NbMNFr6q0pQbsr3+McgenoPQ59Jod4ESJHg8iDwOa8bcGab/8Uhj2OzR+EUrHKAxKHNfFt6MyFNGEYBYfh4OsMfiIG0p7aXBEyOGXs9FEqBl2OdSb+ie3C36nEWgxjZO/KSkaG7/hGQVju9TNmttNVxcANX56BkvNU8UAv1sDH19fuQiGXLhA== X-YMail-OSG: hlCHAb4VM1ncLZyLwPCdeFLm5qkjj.Kviy4_mWA2eYUR90iAWB6ALVgMu8Af6uS gne1IVJG1dFCQbxPPtCBGqDwFxW1YMnYhCacCFAZyBBHdnmNvJzbSelW8lZe.6XLqMqugDrPRtMC 0FphSf7s8z_7Helgx.xqbWDkKY3d.FHZ7VzBYFJsg4o_7mpsYImnkWwrCA6E.7CczQcR0HY4zT81 93MZ1CKHOII.L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ahoo.com with HTTP; Fri, 26 Aug 2022 08:58:57 +0000 Received: by hermes--canary-production-ir2-f74ffc99c-pzqbs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 00c7be35dae4839e69e0ca2d2e4393a1; Fri, 26 Aug 2022 08:58:53 +0000 (UTC) Received: by mail-lj1-f181.google.com with SMTP id bx38so943880ljb.10 for ; Fri, 26 Aug 2022 01:58:53 -0700 (PDT) X-Gm-Message-State: ACgBeo2BFx9bev1Vc5UPGmXzilVenSLmudNuQkL3f1aLAebthKMFVeKk AbuPhFyfVfMIzLGLqn81aKD+elTTLN32H+MfORQ= X-Google-Smtp-Source: AA6agR5kWXy1U+FTGGhlxhk5TXCCvYw3SHtyS4Yq0RhQ9SEtTIS7z5n/0i3TZUWOtZ+Bm48crABsht8gTL9i+kUYUcA= X-Received: by 2002:a05:651c:158c:b0:250:a23d:2701 with SMTP id h12-20020a05651c158c00b00250a23d2701mr2261523ljq.475.1661504332647; Fri, 26 Aug 2022 01:58:52 -0700 (PDT) MIME-Version: 1.0 From: George Moutsopoulos Date: Fri, 26 Aug 2022 09:58:41 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: [BUG] org babel python execute from local buffer to remote session [9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/)] To: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000008a529d05e7211f9e" References: X-Mailer: WebService/1.1.20595 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.176.162; envelope-from=gmoutso@yahoo.co.uk; helo=sonic311-30.consmr.mail.ir2.yahoo.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, HTML_MESSAGE=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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661504466; 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:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=b0zyfg212IzOqNd2fGcMZwqTyY9bZQZWRyTgJdVw0/c=; b=cDGemAS0rOiaUjBBlnsEvWFVpHXnr9wpAGEhUzwbMNkD4WByKXJagGYzTMj8bS4YgiBon5 rJZI1CIDOjsJD78v5zswoc1pl5/EnzPL3iyGnJ8RMYEYCHTTZWRCYg6Wb8nXtzJCDn/P2E CRJTZzmv8GFmRx48TkswoDzEibqZMtzMZE011qfE6cCoD+9SZ7qoBaIXDfTTV66RoYZTQy 9TfDmON5mJvj3y28EgNdU3Aocf83MwvmmGcPL1lQIUxasub8D6/16x/h3D14eE/HZd7mcT Jm/lpowJYANnvwUd/r26jwjzq7dKCEeRpxYRc0U5RxmMPLAAjRC8MH/J2VV68A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661504466; a=rsa-sha256; cv=none; b=myj4doSl8HBPFF5SnzlDXtbYy5jhzKzrNkCYJjVqH/etrQlSgXHwTQ3HsIitrDLf7mDcyC Jh9ZSAsQ0p56ZZcro+Pqz0oV809woWLUajVI4l6M8F6m2d9xH7zpumvcAZDY0G9Cyq63tn X5agqyI6PfV5vegKTBajJDp76TKElFtPFKSoyK006WO83sIjV78t4El0Om6EBI8c93Ase+ jMl/qjtqp9Rwjgsdy+NeymtMn4i/9gHn73unsLbw5YQZN895gDUWhFMq+9+UwFu4gO3QYF XOEQWOV6ljlq5G/bSAKJXXh9vzdrjKi8P1uihC0yqysjEhR6fdjVnC8yTW4kPg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=yahoo.co.uk header.s=s2048 header.b="feG2/cpr"; dmarc=pass (policy=reject) header.from=yahoo.co.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" X-Migadu-Spam-Score: -3.81 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=yahoo.co.uk header.s=s2048 header.b="feG2/cpr"; dmarc=pass (policy=reject) header.from=yahoo.co.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" X-Migadu-Queue-Id: 836223A82D X-Spam-Score: -3.81 X-Migadu-Scanner: scn1.migadu.com X-TUID: g/9UzNmhaC++ --0000000000008a529d05e7211f9e Content-Type: text/plain; charset="UTF-8" Hi all. I often need to run some code on a remote ssh session, because only there I can access a database and the environment is hard to replicate, while I want to keep the code I run on my local machine. The remote session is initialised with run-python after I change default-directory and use pythonic-activate. Sending commands from a local python buffer using python.el works without issues. It would be nice if I can do the same from a local org-mode buffer from a python source block. It does not work because org-babel-python-evaluate-session has two org-babel-temp-file commands that run in the context of the local buffer. If I replace them with (let* ((tmp-src-file (with-current-buffer session (org-babel-temp-file "python-"))) ...) ...) and (let* ((tmp-results-file (with-current-buffer session (org-babel-temp-file "python-"))) ...) ...) then executing the code works again. I have also changed similarly org-babel-python-async-evaluate-session although I haven't tested async. I am hoping this is a change worth making at source, or maybe there is a better way to achieve the same. Thank you. Emacs : GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-06-24 Package: Org mode version 9.5.4 (9.5.4-ge0b05b @ /home/moutsopoulosg/.emacs.d/elpa/org-9.5.4/) --0000000000008a529d05e7211f9e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all. I often need to run some code on a remote ssh sess= ion, because
only there I can access a database and the environment is h= ard to
replicate, while I want to keep the code I run on my local machin= e.

The remote session is initialised with run-python after I change<= br>default-directory and use pythonic-activate. Sending commands from a
= local python buffer using python.el works without issues. It would be nice = if I can do
the same from a local org-mode buffer from a python source b= lock.

It does not work because org-babel-python-evaluate-session has= two
org-babel-temp-file commands that run in the context of the localbuffer. If I replace them with
(let* ((tmp-src-file (with-current-buff= er session (org-babel-temp-file
"python-"))) ...) ...)
and<= br>(let* ((tmp-results-file (with-current-buffer session
(org-babel-temp= -file "python-"))) ...) ...)
then executing the code works aga= in. I have also changed similarly
org-babel-python-async-evaluate-sessio= n
although I haven't tested async.

I am hoping this is a chan= ge worth making at source, or maybe there is
a better way to achieve the= same.

Thank you.


Emacs =C2=A0: GNU Emacs 28.1 (build 2, = x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
=C2=A0o= f 2022-06-24
Package: Org mode version 9.5.4 (9.5.4-ge0b05b @ /home/mout= sopoulosg/.emacs.d/elpa/org-9.5.4/)
--0000000000008a529d05e7211f9e--