GNU bug report logs - #21086
24.5; python.el: python-shell-buffer-substring fails under certain circumstances

Previous Next

Package: emacs;

Reported by: Yuri D'Elia <wavexx <at> thregr.org>

Date: Sat, 18 Jul 2015 16:14:02 UTC

Severity: normal

Merged with 21193

Found in version 25.0.50

Fixed in version 24.5

Done: fgallina <at> gnu.org (Fabián Ezequiel Gallina)

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 21086 in the body.
You can then email your comments to 21086 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#21086; Package emacs. (Sat, 18 Jul 2015 16:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx <at> thregr.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 18 Jul 2015 16:14:02 GMT) Full text and rfc822 format available.

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

From: Yuri D'Elia <wavexx <at> thregr.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; python.el: python-shell-buffer-substring fails under certain
 circumstances
Date: Sat, 18 Jul 2015 18:13:33 +0200
[Message part 1 (text/plain, inline)]
Assuming some python buffer like:

#....
if 1:
    print 1

where the selected region is "print \"1\"" (mark before "p"),
`python-shell-send-region' would fail with:

File "test.py", line 3
    print 1
        ^
IndentationError: expected an indented block

The reason lies within `python-shell-buffer-substring', which assumes
that a region always starts with the correct indentation.

The attached patch fixes the above behavior: when the region doesn't
start with indentation, but the current block does (looking at
(current-indentation)), we prefix the fillstr with the correct amount of
indent.
[python-buffer-substring.patch (text/x-diff, attachment)]

Merged 21086 21193. Request was from fgallina <at> gnu.org (Fabián Ezequiel Gallina) to control <at> debbugs.gnu.org. (Wed, 12 Aug 2015 03:07:02 GMT) Full text and rfc822 format available.

Reply sent to fgallina <at> gnu.org (Fabián Ezequiel Gallina):
You have taken responsibility. (Sun, 23 Aug 2015 23:02:02 GMT) Full text and rfc822 format available.

Notification sent to Yuri D'Elia <wavexx <at> thregr.org>:
bug acknowledged by developer. (Sun, 23 Aug 2015 23:02:02 GMT) Full text and rfc822 format available.

Message #12 received at 21086-done <at> debbugs.gnu.org (full text, mbox):

From: fgallina <at> gnu.org (Fabián Ezequiel Gallina)
To: 21086-done <at> debbugs.gnu.org
Subject: 24.5; python.el: python-shell-buffer-substring fails under certain
 circumstances
Date: Sun, 23 Aug 2015 20:01:15 -0300
Fixed in master at af013e0.

I installed a different patch that seems to be more robust on various
conditions (see tests).


Thanks for such detailed report,
Fabián.




Reply sent to fgallina <at> gnu.org (Fabián Ezequiel Gallina):
You have taken responsibility. (Sun, 23 Aug 2015 23:02:03 GMT) Full text and rfc822 format available.

Notification sent to Jorgen Schaefer <contact <at> jorgenschaefer.de>:
bug acknowledged by developer. (Sun, 23 Aug 2015 23:02:03 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. (Mon, 21 Sep 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 241 days ago.

Previous Next


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