From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joao Cortes Subject: Re: Python source block and :dir header arg Date: Mon, 1 Apr 2019 18:16:53 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:39257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB1UO-0003kX-Vm for emacs-orgmode@gnu.org; Mon, 01 Apr 2019 14:16:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB1UO-0002MW-3P for emacs-orgmode@gnu.org; Mon, 01 Apr 2019 14:16:56 -0400 Received: from mail-oln040092069035.outbound.protection.outlook.com ([40.92.69.35]:63044 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hB1UN-0002Kq-RH for emacs-orgmode@gnu.org; Mon, 01 Apr 2019 14:16:56 -0400 Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "emacs-orgmode@gnu.org" Looking at org-babel-execute-src-block, It seems the only way to get the the intended behavihour is adding :mkdirp "yes" or some other value that gives a true value to the result of the =3Dand=3D call in the following snippet. This is the relevant code at ob-core.el, starting at line 681. #+begin_src emacs-lisp :line yes (default-directory (or (and dir (not (member mkdirp '("no" "nil" nil))) (progn (let ((d (file-name-as-directory (expand-file-name dir)))) (make-directory d 'parents) d))) default-directory)) #+end_src This looks like a bug. If the :dir directory already exists, the :mkdirp parameter should not stop setting the default directory to :dir