From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Bug: verbatim export of python code block with numpy array returns wrong value [8.2.1 (8.2.1-10-g9c1ef6-elpaplus @ /Users/sbagley/Dropbox/emacsd/elpa/org-plus-contrib-20131014/)] Date: Mon, 21 Oct 2013 20:31:27 -0600 Message-ID: <87sivuqbnk.fsf@gmail.com> References: <1382325842.22991.36399041.526C4DD7@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYRlE-0007TR-Oq for emacs-orgmode@gnu.org; Mon, 21 Oct 2013 22:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYRl6-0006Ym-R6 for emacs-orgmode@gnu.org; Mon, 21 Oct 2013 22:31:56 -0400 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]:57726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYRl6-0006Yg-K1 for emacs-orgmode@gnu.org; Mon, 21 Oct 2013 22:31:48 -0400 Received: by mail-pb0-f41.google.com with SMTP id rp16so7922408pbb.28 for ; Mon, 21 Oct 2013 19:31:47 -0700 (PDT) In-Reply-To: <1382325842.22991.36399041.526C4DD7@webmail.messagingengine.com> (Steven Bagley's message of "Sun, 20 Oct 2013 20:24:02 -0700") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Steven Bagley Cc: emacs-orgmode@gnu.org Hi Steve, Is this a Python problem or is it numpy specific? Is repr() a numpy or a Python function i.e., could it replace str() in every Python code block or only when numpy is loaded? Thanks, Steven Bagley writes: > The following file contents, when exported (to HTML or pdf), produce > incorrect output: > #+PROPERTY: header-args:python :session "*Python*" > #+PROPERTY: exports both > #+PROPERTY: results value verbatim > #+BEGIN_SRC python > import numpy as np > np.array([1, 2, 3]) > #+END_SRC > > The resulting value block contains [1 2 3], which is not the print > representation of that numpy array. I suspect the problem arises in > ob-python.el from the use of str() instead of repr(). Thanks. > --Steve > > Remember to cover the basics, that is, what you expected to happen and > what in fact did happen. You don't know how to make a good report? See > > http://orgmode.org/manual/Feedback.html#Feedback > > Your bug report will be posted to the Org-mode mailing list. > ------------------------------------------------------------------------ > > > > Emacs : GNU Emacs 24.3.1 (x86_64-apple-darwin11.4.2, Carbon Version > 1.6.0 AppKit 1138.51) > of 2013-09-24 on Yukikaze.local > Package: Org-mode version 8.2.1 (8.2.1-10-g9c1ef6-elpaplus @ > /Users/sbagley/Dropbox/emacsd/elpa/org-plus-contrib-20131014/) > -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D