python 2.7.12 on Linux behaving differently than on Windows

Michael Torrie torriem at gmail.com
Tue Dec 6 11:33:53 EST 2016


On 12/06/2016 06:52 AM, BartC wrote:
> But those would be silly.

But why?

> Some special syntax is known about: | < and > for example. % less so 
> (I've never, ever used it in live input AFAIK).

Yup and why would you think the ? * special syntax is not known about or
should be known about?  Very strange that you would treat them so
differently.

By the way I use %% environment variable expansion all the time in
Windows.  In fact I most use it in file open dialog boxes or in the Run
dialog.  If I want to see my home folder in a hurry, I'll type Win-R and
then put "%userprofile%" in the box and hit enter. Very convenient.  For
me it's faster to then to browse through explorer and pick folders.
Also it should work regardless of locale, and even if folder names are
localized.

> This auto-expansion causes so many problems, places so many restrictions 
> on what can be done, that it doesn't make sense. Auto-expanding 
> parameters is such a big deal, that it should not be the default 
> behaviour; it needs something to tell the command processor to expand.

Yet you seem to be unable to see that applications doing their own
expansion can also cause problems and restrictions and even worse,
there's not a darn thing you as a user can do about it.

> 
> Then you don't get utterly ridiculous and dangerous behaviour such as 
> the cp example Paul Moore came up with (that trumps most of mine actually):

It's potentially dangerous agreed.  So are lots of commands like rm -rf
/ (which some shells will ask you about).  If you understand a few basic
rules of expansion, you can understand easily what happened or would
happen.  I'm not sure but I think many distros by default in the shell
profiles alias cp="cp -i" and rm="rm -i" to help newbies.  I know the
root account has those aliases by default. I'm pretty sure I've disabled
those aliases for my personal user account because they get in the way
of a lot of my common operations.

Again, I point out that these behaviors can be changed and altered by
the user if he so desires. Right at the shell level.  Instead of having
to alter applications themselves that aren't too smart about things.






More information about the Python-list mailing list