python 3 not detected upon execute buffer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
This is similar to bug #450552.
Version: python-
Upon execute buffer (C-c C-c) in python interpreter:
>>> ## executing temporary file /tmp/Python4165
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'execfile' is not defined
>>>
M-x python3 (C-c !) starts a python 3 interpreter:
Python 3.2 (r32:88445, Mar 25 2011, 19:28:28)
[GCC 4.5.2] on linux2
M-x emacs-version
GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4) of 2011-04-04 on rothera, modified by Debian
M-x py-version
Using `python-mode' version 6.0.3
M-x report-emacs-bug gives (and sent to <email address hidden>)
...
In GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.24.4)
of 2011-04-04 on rothera, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11001000
configured using `configure '--build' 'i686-linux-gnu' '--build' 'i686-linux-gnu' '--prefix=/usr' '--sharedstated
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-
default enable-
Major mode: Python
Minor modes in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-
global-
font-lock-mode: t
blink-
auto-
auto-
line-number-mode: t
transient-
Recent input:
<help-echo> <help-echo> <down-mouse-1> <mouse-1> C-c
C-c <help-echo> M-x r e p o r t - e m a c s - b u g
<return>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Wrote /tmp/Python1912
Load-path shadows:
/usr/share/
/usr/share/
Features:
(shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231
rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc
time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1
hex-util hashcash mail-utils emacsbug imenu python-mode info-look info
py-shell-complete derived easymenu edmacro kmacro cl cl-19 cc-cmds
cc-engine cc-vars cc-defs regexp-opt ansi-color compile comint ring
tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
font-setting tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-
backquote make-network-
font-render-setting gtk x-toolkit x multi-tty emacs)
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
importance: | Undecided → Medium |
milestone: | none → 6.1 |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Update:
this occurs when within a virtualenv with the default python (~/my_virtual_ env/bin/ python) set to a local python 3.2.
Outside of virtualenv if I switch to use python 3.2 by changing py-shell-name to python3 then error does not occur.
If py-shell-name is examined to determine python3 vs python2, would be helpful to have this noted in Install.