From mboxrd@z Thu Jan 1 00:00:00 1970 From: Edmund Christian Herenz Subject: Bug: Tangling python code results in mixed tabs and spaces, incomaptible with python3 [9.1.4 (9.1.4-dist @ /home/ehere/emacs-scripts/org-9.1.4/lisp/)] Date: Wed, 20 Dec 2017 19:24:48 +0100 Message-ID: <20171220182448.6ltm4m4emmt7ftxv@knuspertop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRj32-0004vb-K4 for emacs-orgmode@gnu.org; Wed, 20 Dec 2017 13:24:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRj31-0005lO-OB for emacs-orgmode@gnu.org; Wed, 20 Dec 2017 13:24:56 -0500 Received: from mail-prod-route03.it.su.se ([2001:6b0:5:1213:250:56ff:fe94:7fa1]:57064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRj31-0005jX-GI for emacs-orgmode@gnu.org; Wed, 20 Dec 2017 13:24:55 -0500 Received: from e-mailfilter02.sunet.se (e-mailfilter02.sunet.se [IPv6:2001:6b0:8:2::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail-prod-route03.it.su.se (Postfix) with ESMTPS id 3z238f2TRcz11SY for ; Wed, 20 Dec 2017 19:24:50 +0100 (CET) Received: from smtp.su.se (mail-prod-smtp03.it.su.se [IPv6:2001:6b0:5:131:250:56ff:fe94:f91]) by e-mailfilter02.sunet.se (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id vBKIOmQX150549 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 20 Dec 2017 19:24:49 +0100 Received: from knuspertop (eduroam-10-200-37-112.local.su.se [10.200.37.112]) (Authenticated sender: ehere) by smtp.su.se (Postfix) with ESMTPSA id 3z238c3Hjrz12dY for ; Wed, 20 Dec 2017 19:24:48 +0100 (CET) Content-Disposition: inline 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 The following python code uses only whitespaces for the different indentdation levels: a_list = ['elem1', 'elem2', 'elem3'] for elem in a_list: print(elem) for char in elem: print char I enter this code into a SRC block with #+BEGIN_SRC python :tangle blank_test.py #+END_SRC by pressing C-' inside the block (which opens the editing buffer python-mode). Then I press C-' again, after which I tangle the code to blank_test.py by pressing C-u C-c C-v C-t. The resulting file blank_test.py will contain a mix of tabs and spaces for the different intendation levels. (I checked this with whitespace.el). Above behaviour is a bug, since Python3 forbids mixing of spaces and tabs. (Python2 is more relaxed about mixing of tabs and spaces). Thus, the above code, syntactical correctly entered into an OrgSrc buffer, will result in code that can not be run in python3 when tangled from an org-mode file. Emacs : GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2017-09-12 on hullmann, modified by Debian Package: Org mode version 9.1.4 (9.1.4-dist @ /home/ehere/emacs-scripts/org-9.1.4/lisp/)