Message148352
I've attached a diff to test_shlex.py and a script that I used to
verify what the shells actually do.
Both are relative to Python-3.Lib/test
I'm completely ignoring the quotes issue for now. That should
probably be an enhancement. I don't think it really matters until the
parsing issues are resolved.
ref_shlex is python 2 syntax. python -3 shows that it should convert cleanly.
./ref_shlex.py
It will run by default against /bin/*sh
If you don't want that, do something like: export SHELLS='/bin/sh,/bin/csh'
It runs as a unittest. So you will only see dots if all shells do
what it expects. Some shells are flaky (e.g. zsh, tcsh), so you may
need to run it multiple times.
Getting this into the mainline will be interesting. I would think it
would take some community discussion. I may be able to convince
people that the current behaviour is wrong, but I can't tell you what
will break if it is "fixed". And should the fix be the default? As
you mentioned, it depends on what people expect it to do and how it is
currently being used. I see the first step as presenting a clear case
of how it should work.
-Dan
On Fri, Nov 25, 2011 at 10:01 AM, Éric Araujo <report@bugs.python.org> wrote:
>
> Éric Araujo <merwok@netwok.org> added the comment:
>
>> Of course, that's how it's used. That's all it can do right now.
> :) What I meant is that it is *meant* to be used in this way.
>
>> I was was splitting and combining commands (using ;, &&, and ||) and then running the resulting
>> (mega) one liners over ssh. It still gets run by a shell, but I was specifying the control flow.
> Thank you for the reply. It is indeed a valuable use case to pass a command line as one string to ssh, and the split/quote combo should round-trip and be useful for this usage.
>
>> I'll see if I can come up with a reference case and maybe a unittest this weekend
> Great! A new argument (with a default value which gets us the previous behavior) will probably be needed, to preserve backward compatibility.
>
> ----------
> nosy: +niemeyer
> versions: +Python 3.3 -Python 3.2
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1521950>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2011-11-25 19:25:36 | robodan | set | recipients:
+ robodan, niemeyer, eric.smith, eric.araujo |
2011-11-25 19:25:34 | robodan | link | issue1521950 messages |
2011-11-25 19:25:34 | robodan | create | |
|