GNU bug report logs - #26326
25.1; "import codecs, os;..." Weird output in python shell Mac OS X

Previous Next

Package: emacs;

Reported by: Monib Ahmed <MonibAhmed <at> gmail.com>

Date: Fri, 31 Mar 2017 19:34:02 UTC

Severity: normal

Merged with 21431, 22796, 25753

Found in versions 24.5, 25.1, 25.2, 26.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26326 in the body.
You can then email your comments to 26326 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26326; Package emacs. (Fri, 31 Mar 2017 19:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Monib Ahmed <MonibAhmed <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 31 Mar 2017 19:34:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Monib Ahmed <MonibAhmed <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; "import codecs, os;..." Weird output in python shell Mac OS X
Date: Fri, 31 Mar 2017 12:14:44 -0700
[Message part 1 (text/plain, inline)]
From: Monib Ahmed <monibahmed <at> Monibs-MacBook-Pro.local>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; "import codecs, os;..." Weird output in python shell Mac OS X
--text follows this line--

Hi, I wrote a simple "Hello World" python script, and the output is
weird:

>>> import codecs, os;__pyfile =
codecs.open('''/var/folders/f9/y1xt5ytn02v2n7p8pk3_h4xw0000gn/T/py1281TtN''',
encoding='''utf-8''');__code =
__pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/f9/y1xt5ytn02v2n7p8pk3_h4xw0000gn/T/py1281TtN''');exec(compile(__code,
'''/Users/monibahmed/Documents/Python/people_class/hello_world.py''',
'exec'));
Hi
Hello World!
>>>

Any recommendation on how to fix this?

Thanks,
Monib




In GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version
10.9.5 (Build 13F1911))
 of 2016-09-20 built on builder10-9.porkrind.org
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  pyvenv-mode: t
  shell-dirtrack-mode: t
  global-linum-mode: t
  linum-mode: t
  show-paren-mode: t
  save-place-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Mark set
Mark saved where search started
Mark set
Mark saved where search started
Saving file /Users/monibahmed/.emacs.d/init.el...
Wrote /Users/monibahmed/.emacs.d/init.el
Mark saved where search started
(No changes need to be saved)
previous-line: Beginning of buffer [2 times]
next-line: End of buffer [14 times]
previous-line: Beginning of buffer [3 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums misearch multi-isearch
vc-git diff-mode easy-mmode warnings tramp-cache thingatpt
company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-cmake
company-xcode company-clang company-eclim company-template company-css
company-nxml company-bbdb py-autopep8 flycheck rx subr-x dash yasnippet
highlight-indentation flymake company elpy pyvenv elpy-profile
elpy-django s elpy-refactor python tramp-sh tramp tramp-compat
tramp-loaddefs trampver shell pcomplete format-spec grep compile files-x
etags xref project cus-edit cus-start cus-load wid-edit linum
material-theme ein-notebook eieio-opt speedbar sb-image ezimage dframe
find-func ein-inspector ein-traceback ein-pytools ein-pager
ein-completer ein-subpackages ein-notification ein-scratchsheet
ein-worksheet advice ein-kill-ring ein-cell-output ein-cell-edit
ein-cell ein-output-area xml comint ring ein-kernelinfo ein-kernel
ein-ipdb ein-events eieio-compat ein-websocket websocket bindat
ansi-color ein-contents-api ein-query request mail-utils url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse auth-source cl-seq eieio eieio-core cl-macs gnus-util
mm-util help-fns mail-prsvr password-cache url-vars mailcap cl ein-node
ein-log ein-core ein-utils json map cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ewoc ein-loaddefs
ein finder-inf paren edmacro kmacro saveplace ido info package
epg-config seq byte-opt gv bytecomp byte-compile cl-extra help-mode
easymenu cconv cl-loaddefs pcase cl-lib time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
ns-win ucs-normalize term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 425471 23113)
 (symbols 48 40207 0)
 (miscs 40 902 1134)
 (strings 32 85244 13367)
 (string-bytes 1 2542596)
 (vectors 16 61153)
 (vector-slots 8 1064764 7383)
 (floats 8 1067 542)
 (intervals 56 2595 465)
 (buffers 976 98))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26326; Package emacs. (Fri, 31 Mar 2017 19:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 26326 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Monib Ahmed <MonibAhmed <at> gmail.com>
Cc: 26326 <at> debbugs.gnu.org
Subject: Re: bug#26326: 25.1; "import codecs, os; ..." Weird output in python
 shell Mac OS X
Date: Fri, 31 Mar 2017 15:53:57 -0400
merge 25753 26326
quit

On Fri, Mar 31, 2017 at 3:14 PM, Monib Ahmed <MonibAhmed <at> gmail.com> wrote:
>
> Hi, I wrote a simple "Hello World" python script, and the output is
> weird:
>
>>>> import codecs, os;__pyfile =
>>>> codecs.open('''/var/folders/f9/y1xt5ytn02v2n7p8pk3_h4xw0000gn/T/py1281TtN''',
>>>> encoding='''utf-8''');__code =
>>>> __pyfile.read().encode('''utf-8''');__pyfile.close();os.remove('''/var/folders/f9/y1xt5ytn02v2n7p8pk3_h4xw0000gn/T/py1281TtN''');exec(compile(__code,
>>>> '''/Users/monibahmed/Documents/Python/people_class/hello_world.py''',
>>>> 'exec'));
> Hi
> Hello World!
>>>>
>
> Any recommendation on how to fix this?

Perhaps you can figure out how to make Emacs' python code (see
__PYTHON_EL_native_completion_setup() in python.el) work properly with
a libedit based readline?

Otherwise, you can work around it by installing a GNU readline based
readline module:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25753#74




Merged 25753 26326. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Fri, 31 Mar 2017 19:55:03 GMT) Full text and rfc822 format available.

Merged 21431 25753 26326. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 04 Jun 2017 16:11:02 GMT) Full text and rfc822 format available.

Merged 21431 22796 25753 26326. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 03 Jul 2017 15:26:02 GMT) Full text and rfc822 format available.

Merged 21431 22796 25753 26326 32042. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 02 Jul 2018 20:33:03 GMT) Full text and rfc822 format available.

Disconnected #32042 from all other report(s). Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 11 Jul 2018 00:33:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 Sep 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 214 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.