Re: Modifying a built-in function for logging purposes

2005-05-15 Thread Steven D'Aprano
On Sat, 14 May 2005 15:14:01 -0700, qwweeeit wrote: > Hi Greg, > thank for your replay, but I didn't succeed in any way. You must > consider however that I'm not a Python "expert"... Can you post what you did and what results you got? Because Greg's trick worked for me. See below. > IMHO, it mus

Re: Modifying a built-in function for logging purposes

2005-05-15 Thread qwweeeit
Hi Robert, > Short answer: if you don't know stuff like this, then you probably > shouldn't mess around with the builtins in production code. I begin to be fed up of beeing treated as a child who is only able to make damages... But this time you are right... So let's change point of view: instead o

Re: Modifying a built-in function for logging purposes

2005-05-15 Thread Bengt Richter
On Sun, 15 May 2005 07:52:42 +0200, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: > >> I wonder if it is possible to change (temporarily) a built-in function >> for logging purposes. >> Let me explain: >> I want to log all the 'open' operations, recording the file to be >> o

Re: Modifying a built-in function for logging purposes

2005-05-15 Thread Bengt Richter
On Sat, 14 May 2005 19:19:08 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> Hi Greg, >> thank for your replay, but I didn't succeed in any way. You must >> consider however that I'm not a Python "expert"... >> IMHO, it must be a script that change part of the interprete

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I wonder if it is possible to change (temporarily) a built-in function > for logging purposes. > Let me explain: > I want to log all the 'open' operations, recording the file to be > opened, the "mode" (r/w/a...) and (possibly) the module which made the > call. import s

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi Greg, > thank for your replay, but I didn't succeed in any way. You must > consider however that I'm not a Python "expert"... > IMHO, it must be a script that change part of the interpreter, and > substitute a new module (py) in the place of the standard one (py or > p

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread qwweeeit
Hi Greg, thank for your replay, but I didn't succeed in any way. You must consider however that I'm not a Python "expert"... IMHO, it must be a script that change part of the interpreter, and substitute a new module (py) in the place of the standard one (py or pyc). The standard module must be save

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Greg Krohn
[EMAIL PROTECTED] wrote: > Hi all, > I wonder if it is possible to change (temporarily) a built-in function > for logging purposes. > Let me explain: > I want to log all the 'open' operations, recording the file to be > opened, the "mode" (r/w/a...) and (possibly) the module which made the > call.

Modifying a built-in function for logging purposes

2005-05-14 Thread qwweeeit
Hi all, I wonder if it is possible to change (temporarily) a built-in function for logging purposes. Let me explain: I want to log all the 'open' operations, recording the file to be opened, the "mode" (r/w/a...) and (possibly) the module which made the call. After that the 'open' can carry on foll