Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Gregory Ewing
BartC wrote: Which means that input of A B* *C will all end up running together so that you have no idea what is what or which file corresponds to which expansion. So if you intend your program to be used on unix, you need to design it so that it doesn't depend on such distinctions. Now the p

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Michael Torrie
On 12/07/2016 11:26 PM, Gregory Ewing wrote: > BartC wrote: >> println dirlist(cmdparams[2])# Windows >> println tail(cmdparams) # Linux > > I'm not familiar with your language, so I'll reply > in Python. If you write it like this: > > for arg in sys.argv[1:]: >

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Gregory Ewing
BartC wrote: println dirlist(cmdparams[2])# Windows println tail(cmdparams) # Linux I'm not familiar with your language, so I'll reply in Python. If you write it like this: for arg in sys.argv[1:]: for name in glob(arg): print(name) then the user will

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Gregory Ewing
BartC wrote: Only the tiny minority that can be meaningfully invoked on an arbitrary number of files at the same time. Um... you mean the "tiny minority" that includes just about *every* unix utility that operates on files? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Gregory Ewing
BartC wrote: And globbing doesn't take care of all of it: a Linux program still has to iterate over a loop of filenames. The same as on Windows, except the latter will need to call a function to deliver the next filename. Actually, most of them will require *two* loops, one to iterate over a s

Re: MacOSX SpeechRecognition installation problems

2016-12-07 Thread Michael Torrie
On 12/07/2016 11:09 PM, 3dB wrote: > trying to install SpeechRecognition for Python results in error: > > running install_lib > creating /Library/Python/2.7/site-packages/speech_recognition > error: could not create > '/Library/Python/2.7/site-packages/speech_recognition': Permission deni

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Gregory Ewing
Paul Moore wrote: On Tuesday, 6 December 2016 21:44:18 UTC, Gregory Ewing wrote: What you need to understand is that, to a Unix user, * and ? are *just as well known* as |, < and >. And to Windows users. Just because BartC is proposing a silly distinction between what "Unix users" and "Windo

MacOSX SpeechRecognition installation problems

2016-12-07 Thread 3dB
trying to install SpeechRecognition for Python results in error: running install_lib creating /Library/Python/2.7/site-packages/speech_recognition error: could not create '/Library/Python/2.7/site-packages/speech_recognition': Permission denied Any advice on how to fix? Follow informat

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Gregory Ewing
Steve D'Aprano wrote: I don't know any Unix programs that provide file spec processing. 'find' does, but only for its -name argument, and only because it does something different with it from what the shell would do. And you do need to quote it if it contains glob characters. -- Greg -- https:

Re: sets anomaly

2016-12-07 Thread Steven D'Aprano
On Thursday 08 December 2016 02:17, Rustom Mody wrote: > Trying to write some code using sets (well frozen sets) > And was hit by this anomaly > > This is the behavior of lists I analogously expect in sets: > [] > [] [[]] > [[]] > > ie the empty list and the list of the empty li

Re: Get min and max dates

2016-12-07 Thread Steven D'Aprano
On Thursday 08 December 2016 03:15, DFS wrote: > dts= ['10-Mar-1998', > '20-Aug-1997', > '06-Sep-2009', > '23-Jan-2010', > '12-Feb-2010', > '05-Nov-2010', > '03-Sep-2009', > '07-Nov-2014', > '08-Mar-2013'] > > Of course, the naive:

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steven D'Aprano
On Thursday 08 December 2016 12:15, BartC wrote: > On 08/12/2016 00:09, Steve D'Aprano wrote: >> On Thu, 8 Dec 2016 02:48 am, BartC wrote: > >>> You make it sound like a big deal. Here's a program (in my language not >>> Python) which prints the list of files matching a file-spec: >>> >>> println

PonyORM: generators as a query syntax

2016-12-07 Thread Michael Torrie
I was just made aware of a very interesting ORM project that has been around since about 2013, while listening to a recent episode of the Talk Python To Me podcast. The idea of using generators to build queries is really cool. I'm sure PonyORM has its limitations and drawbacks, as all ORM models

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steven D'Aprano
On Thursday 08 December 2016 11:34, BartC wrote: > On 07/12/2016 23:35, Steve D'Aprano wrote: >> On Thu, 8 Dec 2016 02:19 am, BartC wrote: >> >>> On 07/12/2016 14:34, Steve D'Aprano wrote: >> [...] I don't know why you are so hung up over the number of characters here, or this bogeyman o

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 08/12/2016 00:09, Steve D'Aprano wrote: On Thu, 8 Dec 2016 02:48 am, BartC wrote: You make it sound like a big deal. Here's a program (in my language not Python) which prints the list of files matching a file-spec: println dirlist(cmdparams[2]) Does dirlist provide an escaping mechanism

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Chris Angelico
On Thu, Dec 8, 2016 at 10:35 AM, Steve D'Aprano wrote: > In the Unix world, I'm at the mercy of *one* program, the shell. In your > ideal world, I'm at the mercy of EVERY program that implements globbing: > each and every one has to independently offer a way to disable their own > internal globbin

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 23:35, Steve D'Aprano wrote: On Thu, 8 Dec 2016 02:19 am, BartC wrote: On 07/12/2016 14:34, Steve D'Aprano wrote: [...] I don't know why you are so hung up over the number of characters here, or this bogeyman of "one million files" in a directory. Because /you/ brought it up a

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steve D'Aprano
On Thu, 8 Dec 2016 07:01 am, Skip Montanaro wrote: > Some things are better just left alone. File globbing is probably one > of those things. There's no right answer, and the people in the two > camps will never come to a compromise. Be fair Skip, we've already repeatedly acknowledged that the Un

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steve D'Aprano
On Thu, 8 Dec 2016 02:48 am, BartC wrote: > On 07/12/2016 13:58, Dennis Lee Bieber wrote: >> On Wed, 7 Dec 2016 11:54:35 +, BartC declaimed the >> following: >> >>> With automatic expansion, then EVERY program can become dangerous. Can >>> no one else see this? >>> >> >> With your scheme, EVE

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steve D'Aprano
On Thu, 8 Dec 2016 02:19 am, BartC wrote: > On 07/12/2016 14:34, Steve D'Aprano wrote: [...] >> I don't know why you are so hung up over the number of characters here, >> or this bogeyman of "one million files" in a directory. > > Because /you/ brought it up as a reason why 'globbing' would help

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Ben Bacarisse
BartC writes: > On 07/12/2016 15:25, Ben Bacarisse wrote: >> BartC writes: >> >>> [...] But remember: >>> >>> cp *.c >>> >>> There might be some irate users out there if it can't detect a simple >>> user error like that. >> >> There might be. They are ill-served by current Unix shells. But,

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Chris Angelico
On Thu, Dec 8, 2016 at 7:17 AM, eryk sun wrote: > On Wed, Dec 7, 2016 at 12:39 PM, Chris Angelico wrote: >> Note that two of the Beauty Stone tracks include quotes as well as >> question marks. How do you identify those? Let's say you want to play >> one of these in VLC, and then maybe you decide

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Antoon Pardon
Op 07-12-16 om 19:02 schreef BartC: > On 07/12/2016 16:53, Michael Torrie wrote: >> On 12/07/2016 08:48 AM, BartC wrote: >>> I would prefer that the program "t" can be invoked exactly the same way >>> under both systems. I don't want different instructions for Linux, or >>> for the user (of my lang

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Lew Pitcher
On Wednesday December 7 2016 14:57, in comp.lang.python, "BartC" wrote: > On 07/12/2016 18:02, BartC wrote: > >> If I want to run a Windows program on Linux, and that program needs to >> see *.* unexpanded, then it can't undo that expansion. The cat is >> already out of the bag. > > I mean, the

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread eryk sun
On Wed, Dec 7, 2016 at 12:39 PM, Chris Angelico wrote: > Note that two of the Beauty Stone tracks include quotes as well as > question marks. How do you identify those? Let's say you want to play > one of these in VLC, and then maybe you decide that the track in > Pirates of Penzance/MusicOnly is

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 18:02, BartC wrote: If I want to run a Windows program on Linux, and that program needs to see *.* unexpanded, then it can't undo that expansion. The cat is already out of the bag. I mean, the genie is out of the bottle, whatever. You know what I mean, the operation is not rever

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Skip Montanaro
On Wed, Dec 7, 2016 at 12:17 PM, Anton Mamaenko wrote: > Wow... this thread gets to finally become a holy war. It's not like this particular holy war is new, either. I'm sure it was beaten to death in the days before Windows was a thing. As I indicated in an earlier note, VMS and Unix did command

Re: calling a program from Python batch file

2016-12-07 Thread Stephen Tucker
This might be totally irrelevant, but, if (a) the data to be read by the program during a given run is known when the program is run/launched, (b) that data is purely textual and (c) that data can be read by the program from the stdin channel, then my idea is (1) before the launch, put that data in

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 15:25, Ben Bacarisse wrote: BartC writes: [...] But remember: cp *.c There might be some irate users out there if it can't detect a simple user error like that. There might be. They are ill-served by current Unix shells. But, oddly, the flow has gone the other way. Peopl

Re: sets anomaly

2016-12-07 Thread MRAB
On 2016-12-07 15:33, Ned Batchelder wrote: On Wednesday, December 7, 2016 at 10:18:32 AM UTC-5, Rustom Mody wrote: Trying to write some code using sets (well frozen sets) And was hit by this anomaly This is the behavior of lists I analogously expect in sets: >>> [] [] >>> [[]] [[]] >>> ie the

Re: calling a program from Python batch file

2016-12-07 Thread Michael Torrie
On 12/07/2016 10:59 AM, John Gordon wrote: > In Karim Farokhnia > writes: > >> Hi there, > >> I am writing a batch file in Python. The batch file, in part, calls a >> program named "oq-console.bat" to run. Then once the program comes up >> (it looks like windows CMD), I need the batch file to

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Anton Mamaenko
Wow... this thread gets to finally become a holy war. One method is dealing with this is take the environment as granted (Windows/Unix/Linux/MacOS/Dos sucks while my Windows/Unix/Linux/MacOS/Dos is the best) and figure if the hassle of porting (time, tech, AND moral) worth it. He just "do not

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 16:53, Michael Torrie wrote: On 12/07/2016 08:48 AM, BartC wrote: I would prefer that the program "t" can be invoked exactly the same way under both systems. I don't want different instructions for Linux, or for the user (of my language) to have to write two lots of code, as that i

Re: calling a program from Python batch file

2016-12-07 Thread John Gordon
In Karim Farokhnia writes: > Hi there, > I am writing a batch file in Python. The batch file, in part, calls a > program named "oq-console.bat" to run. Then once the program comes up > (it looks like windows CMD), I need the batch file to type some commands > to make it run (just like I would

Re: calling a program from Python batch file

2016-12-07 Thread Michael Torrie
On 12/07/2016 10:43 AM, Karim Farokhnia wrote: >> Is the program that oq-console.bat runs interactive? After it >> launches into its own console window it asks for more input? > The program doesn't ask for more input parameters as all parameters > are in input files and the program will automatica

Re: calling a program from Python batch file

2016-12-07 Thread Karim Farokhnia
On Wednesday, December 7, 2016 at 12:18:51 PM UTC-5, Michael Torrie wrote: > On 12/07/2016 09:38 AM, Karim Farokhnia wrote: > > I am writing a batch file in Python. The batch file, in part, calls a > > program named "oq-console.bat" to run. Then once the program comes up > > (it looks like windows

Re: calling a program from Python batch file

2016-12-07 Thread Bob Gailer
On Dec 7, 2016 11:40 AM, "Karim Farokhnia" wrote: > > Hi there, > > I am writing a batch file in Python. The batch file, in part, calls a program named "oq-console.bat" to run. Then once the program comes up (it looks like windows CMD), I need the batch file to type some commands to make it run (j

Re: "Best" websocket implementation for Python 2.x?

2016-12-07 Thread justin walters
On Wed, Dec 7, 2016 at 8:50 AM, Skip Montanaro wrote: > PyPI came back. A bit more sleuthing suggests that the > websocket-client package on PyPI is Ohtani's package, and is more > up-to-date than the copyright notices would suggest. The package was > updated a few days ago on GitHub. > > Taking

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Michael Torrie
On 12/07/2016 07:57 AM, BartC wrote: > I don't follow you. "?" is problematical on both systems. I think > Windows disallows it completely: I get 'Protocol error' if I copy such a > file from Linux to Windows. Presumably there is an escaping system, but > I don't know what it is. As Chris says,

Re: calling a program from Python batch file

2016-12-07 Thread Michael Torrie
On 12/07/2016 09:38 AM, Karim Farokhnia wrote: > I am writing a batch file in Python. The batch file, in part, calls a > program named "oq-console.bat" to run. Then once the program comes up > (it looks like windows CMD), I need the batch file to type some > commands to make it run (just like I wou

Re: Django broken pipe error

2016-12-07 Thread justin walters
On Wed, Dec 7, 2016 at 1:08 AM, wrote: > Thank you Justin, > > I'm on the dev server and should present results in this way. > > Yes, I use manage.py runserver --insecure to start the server (from > PyCharm). > > My views.py call: > > @detail_route(methods=['post'], permission_classes=[permission

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Michael Torrie
On 12/07/2016 08:48 AM, BartC wrote: > I would prefer that the program "t" can be invoked exactly the same way > under both systems. I don't want different instructions for Linux, or > for the user (of my language) to have to write two lots of code, as that > is my job... Ahh now we come to the

Re: "Best" websocket implementation for Python 2.x?

2016-12-07 Thread Skip Montanaro
PyPI came back. A bit more sleuthing suggests that the websocket-client package on PyPI is Ohtani's package, and is more up-to-date than the copyright notices would suggest. The package was updated a few days ago on GitHub. Taking the path of least resistance (no changes necessary to the code), I

calling a program from Python batch file

2016-12-07 Thread Karim Farokhnia
Hi there, I am writing a batch file in Python. The batch file, in part, calls a program named "oq-console.bat" to run. Then once the program comes up (it looks like windows CMD), I need the batch file to type some commands to make it run (just like I would do it by myself). I need the batch f

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Michael Torrie
On 12/07/2016 07:58 AM, Marko Rauhamaa wrote: > Steve D'Aprano : > >> I don't know any Unix programs that provide file spec processing. >> (That's not to say that there are absolutely none, only that I don't >> know of any.) > > I can think of "find", "git" and "scp". > > Git supports the recurs

"Best" websocket implementation for Python 2.x?

2016-12-07 Thread Skip Montanaro
I've recently inherited a small bit of code which uses websockets. I think the package it uses is Horoki Ohtani's package dating from 2010. I have v. 0.34.0. Looking on PyPI, I see another websocket package (not Ohtani's) with a version of 0.2.1 (also dating from 2010, I believe). These two packag

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Chris Angelico
On Thu, Dec 8, 2016 at 2:19 AM, BartC wrote: > OK, but you go first: how does a Linux program tell the difference between: > > A B C > > which signifies three files, and: > > A B C > > which means two files, and an option C? And without using escapes! The option would be called "-C", which me

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Chris Angelico
On Thu, Dec 8, 2016 at 1:57 AM, BartC wrote: > On 07/12/2016 12:39, Chris Angelico wrote: >> >> On Wed, Dec 7, 2016 at 10:54 PM, BartC wrote: >>> >>> But if a program existed that took N filename parameters with the purpose >>> of >>> deleting each of them, then it can't tell if they were typed i

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 13:58, Dennis Lee Bieber wrote: On Wed, 7 Dec 2016 11:54:35 +, BartC declaimed the following: With automatic expansion, then EVERY program can become dangerous. Can no one else see this? With your scheme, EVERY PROGRAM HAS TO IMPLEMENT ITS OWN GLOBBING. Only the

Re: Detect Linux Runlevel

2016-12-07 Thread Marko Rauhamaa
Grant Edwards : > There are a few things in Unix that are fundamentally broken and > really just can't be used for the things they are intended for (serial > ports come to mind). > > However, that doesn't seem to prevent them from having been used > sucessfully that way way for 40 years. ;) Sigh.

Re: sets anomaly

2016-12-07 Thread Ned Batchelder
On Wednesday, December 7, 2016 at 10:18:32 AM UTC-5, Rustom Mody wrote: > Trying to write some code using sets (well frozen sets) > And was hit by this anomaly > > This is the behavior of lists I analogously expect in sets: > > >>> [] > [] > >>> [[]] > [[]] > >>> > > ie the empty list and the l

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Ben Bacarisse
BartC writes: > [...] But remember: > > cp *.c > > There might be some irate users out there if it can't detect a simple > user error like that. There might be. They are ill-served by current Unix shells. But, oddly, the flow has gone the other way. People have wanted Unix shells and utilit

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 14:34, Steve D'Aprano wrote: On Wed, 7 Dec 2016 11:23 pm, BartC wrote: On 07/12/2016 05:15, Steven D'Aprano wrote: On Wednesday 07 December 2016 12:55, BartC wrote: But even Linux's 128KB will fill if someone wanted a command line that listed 20,000 files individually. But it w

sets anomaly

2016-12-07 Thread Rustom Mody
Trying to write some code using sets (well frozen sets) And was hit by this anomaly This is the behavior of lists I analogously expect in sets: >>> [] [] >>> [[]] [[]] >>> ie the empty list and the list of the empty list are different things However (with f= frozenset ) >>> f() frozenset() >>

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Paul Moore
On Wednesday, 7 December 2016 11:55:01 UTC, BartC wrote: > With automatic expansion, then EVERY program can become dangerous. Can > no one else see this? Please start an elevated command prompt on your PC, and type the command rmdir /s /q C:\WINDOWS There are no special characters here, so

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Paul Moore
On Tuesday, 6 December 2016 21:44:18 UTC, Gregory Ewing wrote: > BartC wrote: > > But those would be silly. > > > > Some special syntax is known about: | < and > for example. % less so > > What you need to understand is that, to a Unix user, > * and ? are *just as well known* as |, < and >. And

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Marko Rauhamaa
Steve D'Aprano : > I don't know any Unix programs that provide file spec processing. > (That's not to say that there are absolutely none, only that I don't > know of any.) I can think of "find", "git" and "scp". Git supports the recursive "**" wildcard, as well. Marko -- https://mail.python.o

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 12:39, Chris Angelico wrote: On Wed, Dec 7, 2016 at 10:54 PM, BartC wrote: But if a program existed that took N filename parameters with the purpose of deleting each of them, then it can't tell if they were typed in individually (so indicating a stronger intent), or whether a fing

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Paul Moore
On Tuesday, 6 December 2016 16:34:10 UTC, Michael Torrie wrote: > On 12/06/2016 06:52 AM, BartC wrote: > > 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.

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steve D'Aprano
On Wed, 7 Dec 2016 11:23 pm, BartC wrote: > On 07/12/2016 05:15, Steven D'Aprano wrote: >> On Wednesday 07 December 2016 12:55, BartC wrote: >> >>> But even Linux's 128KB will fill if someone wanted a command line that >>> listed 20,000 files individually. But it would be spectacularly bad use >>>

Re: Detect Linux Runlevel

2016-12-07 Thread Grant Edwards
On 2016-12-07, Marko Rauhamaa wrote: > Steven D'Aprano : > >> Whereas if it were mandatory locking, enforced by the OS, it >> wouldn't be a problem? > > The point is, the utmp scheme seems to be fundamentally broken. You > can't use a regular file for this kind of communication. There are a few t

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread eryk sun
On Wed, Dec 7, 2016 at 9:43 AM, Chris Angelico wrote: > Exactly. Back in the 1990s, we had the beginnings of Windows NT, which > was designed for servers. It had (if I recall correctly) no concept of > file/directory permissions, little or no notion of process privilege, > and definitely no way to

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steve D'Aprano
On Thu, 8 Dec 2016 12:07 am, eryk sun wrote: >> latest step is Microsoft's partnership with Canonical (the company behind >> Ubuntu Linux) to bring bash to Windows. > > The partnership with Canonical is to provide an entire Linux > distribution, sans the kernel. The Windows Subsystem for Linux (W

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Marko Rauhamaa
Chris Angelico : > $ find Music/ -name *\\?* I do recommend quoting your wildcard characters. Yet further nasty security pitfalls in bash programming: 5. Wildcards that don't match any file are left unexpanded. 6. Commands behave unexpectedly when given null lists: $ ls a b c a

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread eryk sun
On Wed, Dec 7, 2016 at 8:30 AM, Steven D'Aprano wrote: > > There are Windows programs which understand globs, like dir. Do you honestly > expect us to believe that it is okay to use "dir a*" on Windows because dir > itself expands the glob, but not okay to use "dir a*" on Linux because the > shell

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Chris Angelico
On Wed, Dec 7, 2016 at 10:54 PM, BartC wrote: > But if a program existed that took N filename parameters with the purpose of > deleting each of them, then it can't tell if they were typed in individually > (so indicating a stronger intent), or whether a finger slipped on a single > filename and a

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 05:15, Steven D'Aprano wrote: On Wednesday 07 December 2016 12:55, BartC wrote: But even Linux's 128KB will fill if someone wanted a command line that listed 20,000 files individually. But it would be spectacularly bad use of a command line interface which was designed for humans.

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 08:30, Steven D'Aprano wrote: On Wednesday 07 December 2016 03:41, BartC wrote: On 06/12/2016 15:44, Michael Torrie wrote: On 12/06/2016 04:43 AM, BartC wrote: Yes shell expansion has it's gotchas. But those can all be learned, Yes, learn to avoid wildcards in command param

Re: Detect Linux Runlevel

2016-12-07 Thread Marko Rauhamaa
Steven D'Aprano : > Whereas if it were mandatory locking, enforced by the OS, it wouldn't > be a problem? The point is, the utmp scheme seems to be fundamentally broken. You can't use a regular file for this kind of communication. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Chris Angelico
On Wed, Dec 7, 2016 at 7:30 PM, Steven D'Aprano wrote: > If you accidentally say "del *" on Windows, say, when you meant "z*" for > example, and Windows deletes all the files in the current directory, do you > say > to yourself...? > >"Thank the deities that * was expanded by the del command

Re: Django broken pipe error

2016-12-07 Thread dr . roman . graf
On Tuesday, December 6, 2016 at 3:22:13 PM UTC+1, dr.rom...@gmail.com wrote: > Hi, > > I'm facing strange Django broken pipe error (Python 2.7 on Ubuntu) that > apparently is a not fixed Django bug. Does anybody now how to fix it? I've > been searching a lot and didn't find any solution. > > Th

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Peter Otten
Steven D'Aprano wrote: > Tell me Bart, what's the difference between these? > > # Linux > rm * > > and > > # Windows > del * Is there an equivalent to # touch -- -r on Windows? Like in $ tree . |-- -r |-- a | `-- b | `-- c | `-- bar.txt `-- foo.txt 3 directories, 3 files

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Steven D'Aprano
On Wednesday 07 December 2016 03:41, BartC wrote: > On 06/12/2016 15:44, Michael Torrie wrote: >> On 12/06/2016 04:43 AM, BartC wrote: > >> Yes shell expansion has it's gotchas. But those can all be learned, > > Yes, learn to avoid wildcards in command parameters at all costs. But we > both kno

Re: Detect Linux Runlevel

2016-12-07 Thread Steven D'Aprano
On Wednesday 07 December 2016 18:08, Marko Rauhamaa wrote: >This is a problem with advisory locking. The fact that anyone can >create an exclusive lock on a file they can only read! Is this >behavior appropriate? > >https://www.redhat.com/archives/linux-security/1996-Novembe >