bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25025: python-shell-calculate-command is wrong


From: Eli Zaretskii
Subject: bug#25025: python-shell-calculate-command is wrong
Date: Fri, 02 Dec 2016 09:35:38 +0200

> From: address@hidden
> Cc: address@hidden,  address@hidden
> Date: Thu, 01 Dec 2016 20:12:13 -0500
> 
> Eli Zaretskii <address@hidden> writes:
> >
> > So the problematic scenario is that the user sets
> > python-shell-interpreter to something we already checked, and then
> > manually feeds us with a command that invokes a different Python
> > interpreter, is that it?  Is that a frequent use case, which we
> > should care about?  Just to produce a warning?
> >
> > Even if we do want to care about, we could try matching the beginning
> > of the command, perhaps after an optional quote character, and if we
> > don't recognize the interpreter, do nothing.  Would that be
> > sufficient?
> 
> To be honest, I don't use python enough to say what the best fix is
> here.

Me neither.

> I can say that the easiest way to solve this bug is:
> 
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -2379,7 +2379,7 @@ python-shell-internal-get-process-name
>  (defun python-shell-calculate-command ()
>    "Calculate the string used to execute the inferior Python process."
>    (format "%s %s"
> -          (shell-quote-argument python-shell-interpreter)
> +          (combine-and-quote-strings (list python-shell-interpreter))
>            python-shell-interpreter-args))

Isn't combine-and-quote-strings wrong for quoting shell commands?
AFAIR, it doesn't DTRT with some special characters that can appear in
file names on Unix.  Am I mistaken?

But if my fears are unjustified, sure, why not?  Clément, WDYT?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]