[Python-mode] [ python-mode-Patches-783262 ] python-mode py-execute-buffer bug

SourceForge.net noreply at sourceforge.net
Sat Oct 23 19:46:08 CEST 2004


Patches item #783262, was opened at 2003-08-04 22:35
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783262&group_id=86916

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: python-mode py-execute-buffer bug

Initial Comment:
migrated #779839 from python project.

Original Submission:

The rest of this report is a quote from Skip's message 
in 
 c.l.py. 
  
 Attached is Skip's tentative patch (which is likely 
 incorrect for Jython). 
  
 --------------------------------- 
     John> 1. Why do I get this in my minibuffer when 
I do 
     John> C-c C-c in a python-mode buffer containing 
the 
     John> following valid Python code? 
  
     John> Wrong type argument: sequencep, cpython 
  
 It looks like a bug in py-execute-region.  It sets the 
shell 
 variable like so: 
  
         (setq shell (or (py-choose-shell-by-shebang) 
 (py-choose-shell-by-import) py-which-shell)))) 
  
 which gives it the value (quote cpython).  Later on it 
tries 
 to concatenate it: 
  
       (let ((cmd (concat shell (if (string-equal 
 py-which-bufname "JPython") " -" "")))) 
  
 which fails because shell is not a string (strictly 
 speaking, a sequence) at that point.  I'm not sure 
what 
 the correct fix is.

----------------------------------------------------------------------

>Comment By: Skip Montanaro (montanaro)
Date: 2004-10-23 12:46

Message:
Logged In: YES 
user_id=44345

Applied Ted Whalen's patch (v 4.66 of python-mode.el).
I can't test - Jythoneers, here's your chance...


----------------------------------------------------------------------

Comment By: ted whalen (tew)
Date: 2004-09-13 16:33

Message:
Logged In: YES 
user_id=52548

I think what we want here is:

--- /usr/share/emacs/site-lisp/python-mode/python-mode.el  
    2004-03-06 01:16:19.000000000 -0600
+++ lib/elisp/python-mode.el    2004-09-13
16:25:17.000000000 -0500
@@ -1686,7 +1686,7 @@
       (setq py-exception-buffer (cons file (current-buffer))))
      (t
       ;; TBD: a horrible hack, but why create new Custom
variables?
-      (let ((cmd (concat shell (if (string-equal
py-which-bufname "JPython")
+      (let ((cmd (concat py-which-shell (if (string-equal
py-which-bufname "JPython")
                                   " -" ""))))
        ;; otherwise either run it synchronously in a subprocess
        (save-excursion

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783262&group_id=86916


More information about the Python-mode mailing list