From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id lDw+NRiUV198GgAA0tVLHw (envelope-from ) for ; Tue, 08 Sep 2020 14:24:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cOSdMBiUV1+JAgAAbx9fmQ (envelope-from ) for ; Tue, 08 Sep 2020 14:24:24 +0000 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 6DA8C94028F for ; Tue, 8 Sep 2020 14:24:24 +0000 (UTC) Received: from localhost ([::1]:43944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFeXn-0000hH-E5 for larch@yhetil.org; Tue, 08 Sep 2020 10:24:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFeWx-0000FU-Nd for emacs-orgmode@gnu.org; Tue, 08 Sep 2020 10:23:31 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:43272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFeWu-0006IF-C3; Tue, 08 Sep 2020 10:23:31 -0400 Received: by mail-pf1-x443.google.com with SMTP id f18so11071033pfa.10; Tue, 08 Sep 2020 07:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=R9vgu7OKLu2HpAhdqYLgGZ0fvDfooauewnobWbmMuoE=; b=ObigONDRUTRAZdDHJcjT2RpCX8RIhrHft4klV0X+S77FA80Cd73EyMpcmkOerPmJKJ 9HyHc4yNhLhiCqQ1NNIaa+P+xK+uu+HbCEIfq7s9uN0UgQNzQ6ll+RwMsrJWhuVjYsnJ w+YPDgghvjYWricBosT42cw7z3dLMuUchFLnFNH75Xyy2joEpf5W/PLwnswdkT+lIB+Z JHNFGaQAjKmJuyeiscmmHB5wCr+bZgBgS2Lr6mOL4fjp1mnyINq4EKHq4sYxEni+AVEb h4H160brUMezkDalCSpZTFp49ED9jtnZFA0oSEN9C2zHTsYc19jIHl2Erpa9Lwvly1M4 Egbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=R9vgu7OKLu2HpAhdqYLgGZ0fvDfooauewnobWbmMuoE=; b=uNmEIwRJHiomt8bv88AFZKlNOAkQQCzdrZbahvakiyu7zVB6vxnrMz9dI7HkMeWzff aeMQIrBrbAwuR3m/igM2IS3RP2or1t7Yblz8508EPvCP9tAIFg7kq2FSdmumQJ7ukH1N pEc7AIWCM+CynBN/MkRNm1OUlAhsWH2o+soIrYF+Us2EcSHufNl+nrunPR/5X2CJ3s8W +92092tJh4HgVzm5JXJ2R3bHNEUMxZL+kz/QU6e3spputV8BTi97NgT/hOpudBWuzfni bzxCpqNPHoN9FC2GKAou50/SgsbmBSXy98OSrLdAUSdeEhOD2ojZdAIFrjR+s6UoNagW /nfA== X-Gm-Message-State: AOAM531JonI8C0OxtYIZxR7sLw48al7SZRTH2lrOqhQz0S4PhnZ582NB 7ZShHG+85fQ/a23d99ayWzw= X-Google-Smtp-Source: ABdhPJzXlvUlPm2XGa9uKtWDyA9lJts+Z+PZIO5wfLA1Y74ndGQwO0LZX+gzGwDjOWDF+TC7At55bg== X-Received: by 2002:a63:d648:: with SMTP id d8mr20331271pgj.4.1599575006202; Tue, 08 Sep 2020 07:23:26 -0700 (PDT) Received: from localhost (199-83-220-90.PUBLIC.monkeybrains.net. [199.83.220.90]) by smtp.gmail.com with ESMTPSA id o30sm16181709pgc.45.2020.09.08.07.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 07:23:25 -0700 (PDT) From: Jack Kamm To: Kyle Meyer , No Wayman Subject: Re: [PATCH] org-add-planning-info: respect caller's given time [9.3.7 (release_9.3.7-716-g3d4876 @ /home/n/.emacs.d/straight/build/org/)] In-Reply-To: <871rjcan53.fsf@kyleam.com> References: <87zh6rfvmi.fsf@gmail.com> <87ft7wdxjl.fsf@gnu.org> <871rjgi4mb.fsf@gmail.com> <87mu239q8b.fsf@gnu.org> <87blihpndy.fsf@gmail.com> <871rjcan53.fsf@kyleam.com> Date: Tue, 08 Sep 2020 07:23:24 -0700 Message-ID: <877dt4bb4z.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::443; envelope-from=jackkamm@gmail.com; helo=mail-pf1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastien , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=ObigONDR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: 7NOEByoLpsU1 --=-=-= Content-Type: text/plain Kyle Meyer writes: > That's on a Debian system with the python executable pointing to Python > 2.7.16. If I set org-babel-python-command to python3 (3.7.3) at the top > of test-ob-python.el, I see the same thing. I haven't dug any farther > yet. Jack, presumably you don't see the stall on your end? No, the tests don't stall on my end (Archlinux with manually compiled emacs 28). I also tested on a debian10vm and the tests passed there too. But since we know it's related to 4df12ea39 that gives some clues...could you try the attached patch to see if it fixes things? Also, could you try executing some simple ob-python session blocks and see if they hang? e.g., #+begin_src python :session :results output print(1+1) #+end_src #+begin_src python :session :results value 1+1 #+end_src --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=python-eoe-patch.patch diff --git a/lisp/ob-python.el b/lisp/ob-python.el index 1cded4515..a5af55892 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -223,6 +223,9 @@ (defun org-babel-python-initiate-session (&optional session _params) (org-babel-python-session-buffer (org-babel-python-initiate-session-by-key session)))) +(defvar org-babel-python-eoe-indicator "org_babel_python_eoe" + "A string to indicate that evaluation has completed.") + (defconst org-babel-python-wrapper-method " def main(): @@ -324,7 +327,9 @@ (defun org-babel-python--send-string (session body) (comint-output-filter-functions (cons (lambda (text) (setq string-buffer (concat string-buffer text))) - comint-output-filter-functions))) + comint-output-filter-functions)) + (body (format "%s\nprint('%s')" + body org-babel-python-eoe-indicator))) (if (not (eq 'python-mode org-babel-python-mode)) (let ((python-shell-buffer-name (org-babel-python-without-earmuffs session))) @@ -333,13 +338,10 @@ (defun org-babel-python--send-string (session body) (py-shell-send-string body (get-buffer-process session))) ;; same as `python-shell-comint-end-of-output-p' in emacs-25.1+ (while (not (string-match - (concat "\r?\n?" - (replace-regexp-in-string - (rx string-start ?^) "" comint-prompt-regexp) - (rx eos)) + org-babel-python-eoe-indicator string-buffer)) (accept-process-output (get-buffer-process (current-buffer)))) - (substring string-buffer 0 (match-beginning 0))))) + (org-babel-chomp (substring string-buffer 0 (match-beginning 0)))))) (defun org-babel-python-evaluate-session (session body &optional result-type result-params) --=-=-=--