py-execute-buffer-python3 looks broken

Bug #1085386 reported by Stéphane Castelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
High
Andreas Roehler

Bug Description

Hello,

when i execute py-execute-buffer-python3 from emacs 24.2.1 on Fedora 18 with the r1154, the buffer is executed, but the display in *Python3* is all broken, whereas py-execute-buffer-python2 works perfectly well. It was doing it also with the previous version of python-mode. I do not know if it is a python-mode bug or an emacs one. See the attachment to have a visual.

Thank you for this great mode.

Revision history for this message
Stéphane Castelli (stephcastelli) wrote :
Changed in python-mode:
milestone: none → 6.1.0
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → High
status: New → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Last commit might be the cupable. Setting py-use-current-dir-when-execute-p to nil should make it work for the moment. Fix en route.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Please try again, thanks.

Revision history for this message
Stéphane Castelli (stephcastelli) wrote :

It is still the same thing, even if i turn on nil py-use-current-dir-when-execute-p. The output is written in the middle of the stuff written by the python shell at the launch, and if there are several outputs, they are written backward. The most weird is that it works well with the python2 shell though, but not with python3, so I do not know if it is really the mode fault.

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1085386] Re: py-execute-buffer-python3 looks broken

Am 01.12.2012 23:54, schrieb Stéphane Castelli:
> It is still the same thing, even if i turn on nil py-use-current-dir-
> when-execute-p. The output is written in the middle of the stuff written
> by the python shell at the launch, and if there are several outputs,
> they are written backward. The most weird is that it works well with the
> python2 shell though, but not with python3, so I do not know if it is
> really the mode fault.
>

Assume there is a bug in python-mode.el, which might occur in some circumstances only.

When starting emacs -Q, loading python-mode.el, M-x python3 RET, in order zu initialize i = 0,
M-x py-execute-buffer-python3 Your-test.py yields like png attached.

May you reproduce this so far?

Revision history for this message
Stéphane Castelli (stephcastelli) wrote :

Ok so actually, without my .emacs it works. After somes tests, it appears that it is the line "(setq-default py-shell-name "python3")" that breaks the display.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Am 02.12.2012 18:01, schrieb Stéphane Castelli:
> Ok so actually, without my .emacs it works. After somes tests, it
> appears that it is the line "(setq-default py-shell-name "python3")"
> that breaks the display.
>

Doesn't make a difference here, starting M-x py-shell or M-x python3.

Need some detailed description, which steps trigger the bug.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Am 02.12.2012 18:01, schrieb Stéphane Castelli:

BTW unexpected display may happen when jumping across the output buffer, editing there and sending output after again.
Might do something in this cases too, but need the precise case.

Revision history for this message
Stéphane Castelli (stephcastelli) wrote :

With emacs -Q, the bug does not happen (never). Launching normally emacs but without the line "(setq-default py-shell-name "python3")", the bug does not happen. With that line, then it happens whenever there is an output (or an exception), even if I did not touch the python shell. If I put instead "(setq py-shell-name "python3")" in python-mode-hook it works well, but it launches a python2 shell at the launch (which is normal, but not what I want). If there is an alternative to "setq-default" to have a python3 shell at the beginning, I think it could solve the problem. Thanks to take some time.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Customzing py-shell-name "python3" should DTRT.

Will close this as "Fix committed". Please flag "New" again, if needed.

Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.