py-execute-import-or-reload bug with python3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
Hi,
I think there is a bug when running C-c RET using a python3 interpreter. The following are the steps to reproduce the error:
1. Create a new python file, e.g. xxx.py
2. C-u C-! and type 'python3'.
3. Type any valid python expression, e.g. print("hello world"). There is no need to import any modules.
4. C-c C-c (python3 correctly executes the file).
5. C-c RET and press RET again. The last RET is bound to the command comint-send-input. To be precise, C-c RET moves me to the *Python3* buffer, where the cursor is preceded by '... ... ... ...'. Typing anything e.g. print("hello") followed by RET would result in the following error:
File "<stdin>", line 5
^
SyntaxError: invalid syntax
6. Results in the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeE
The following are my systems details:
Emacs version: GNU Emacs 24.0.92.2 (x86_64-
python-mode.el version: 6.0.4
Python3 interpreter version: Python 3.1.4
The following is the output of M-x report-emacs-bug
In GNU Emacs 24.0.92.2 (x86_64-
of 2012-01-14 on localhost
configured using `configure '--prefix=/usr' '--build=
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: nil
value of $XMODIFIERS: nil
locale-
default enable-
Major mode: Comint
Minor modes in effect:
ido-everywhere: t
shell-
file-
global-
font-lock-mode: t
auto-
auto-
auto-
line-number-mode: t
transient-
Recent input:
ESC [ > 0 ; 1 1 5 ; 0 c x C-x 1 C-x C-f / t m p RET
s a m p RET C-x C-s C-u C-c ! 3 RET C-x o C-c C-c C-x
o C-c RET RET ESC x r e p o TAB r TAB RET
Recent messages:
("/usr/bin/emacs")
Loading ido...done
OVERVIEW
(No changes need to be saved)
Python3
Wrote /tmp/Python3164
(No files need saving)
Making completion list...
Load-path shadows:
/etc/emacs/
Features:
(shadow sort mail-extr message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev
mail-utils gmm-utils mailheader emacsbug help-mode view imenu org-indent
org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo
org-infojs org-html org-exp ob-exp org-exp-blocks org-info org-gnus
org-docview org-bibtex bibtex org-bbdb tramp-cache tramp tramp-compat
auth-source eieio gnus-util mm-util mail-prsvr password-cache
format-spec tramp-loaddefs org-colview clojure-
paredit-autoloads package tabulated-list zenburn-theme ido cus-start
cus-load cal-iso org-agenda remember org-remember org-datetree org
byte-opt warnings bytecomp byte-compile cconv macroexp ob-emacs-lisp
ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
ob ob-eval org-pcomplete org-list org-faces org-compat org-entities
org-macs time-date noutline outline easy-mmode cal-menu calendar
cal-loaddefs python-mode rx advice advice-preload derived edmacro kmacro
highlight-
tool-bar cl site-gentoo ess-toolbar ess-mouse mouseme thingatpt
browse-url ess-menu ess-swv ess-noweb noweb-font-
essd-els ess-sas-d ess-sas-l ess-sas-a executable shell pcomplete
ess-arc-d ess-vst-d ess-xls-d ess-lsp-l ess-sta-d ess-sta-l cc-vars
cc-defs make-regexp ess-sp6-d ess-sp5-d ess-sp3-d ess-r-d ess-r-args
assoc ess-s-l ess-inf ess-utils comint ring ess-mode noweb-mode ess
ess-custom regexp-opt easymenu ess-compat ess-site ediff-hook vc-hooks
lisp-float-type lisp-mode register page menu-bar rfn-eshadow timer
select 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 minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-
multi-tty emacs)
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
status: | Fix Committed → In Progress |
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Am 30.01.2012 03:36, schrieb Sara: pc-linux- gnu)
> Public bug reported:
>
> Hi,
>
> I think there is a bug when running C-c RET using a python3
> interpreter. The following are the steps to reproduce the error:
>
> 1. Create a new python file, e.g. xxx.py
>
> 2. C-u C-! and type 'python3'.
>
> 3. Type any valid python expression, e.g. print("hello world")
>
> 4. C-c C-c (python3 correctly executes the file).
>
> 5. C-c RET and press RET again.
>
> 6. Results in the following error:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in<module>
> AttributeError: 'dict' object has no attribute 'has_key'
>
> The following are my systems details:
>
> Emacs version: GNU Emacs 24.0.92.2 (x86_64-
> python-mode.el version: 6.0.4
> Python3 interpreter version: Python 3.1.4
>
Hi,
can you tell which modules should be imported?
What does the last RET, i.e. which command then is bound to?
Did you return to original buffer, resp. stayed there?
Please send the output from M-x report-emacs-bug.
Thanks,
Andreas