Re: Python String Immutability Broken!

2008-08-26 Thread Hendrik van Rooyen
"Simon Brunning": >You can indeed use ctypes to modify the value of a string - see >. You can use it to crash the OS, too. > >My advice - don't. Thanks for the link. Any advice on what to do or use as an I/O structure for dissemination? Ken Seehart: 8<--- u

Re: Python String Immutability Broken!

2008-08-25 Thread Terry Reedy
Ken Seehart wrote: Hendrik van Rooyen wrote: ... Actually, I am not complaining - I am asking for advice on the side effects of what I am doing, which is replacing a bunch of bits in what is essentially an output bit field with the corresponding input bits at the same addresses read back fr

Re: Python String Immutability Broken!

2008-08-25 Thread Patrick Maupin
On Aug 25, 3:31 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Actually, I am not complaining - I am asking for advice on the side > effects of what I am doing, which is replacing a bunch of bits > in what is essentially an output bit field with the corresponding > input bits at the same add

Re: Python String Immutability Broken!

2008-08-25 Thread Gabriel Genellina
En Mon, 25 Aug 2008 17:31:22 -0300, Hendrik van Rooyen <[EMAIL PROTECTED]> escribió: > Patrick Maupin wrote: > >>But let me get this straight: Are you just complaining that if you >>pass a string to an arbitrary C function using ctypes, that that >>arbitrary function can modify the string? > >

Re: Python String Immutability Broken!

2008-08-25 Thread Peter Otten
Steven D'Aprano wrote: > On Mon, 25 Aug 2008 03:43:01 -0700, Ken Seehart wrote: > >> You can also use ctypes to globally change the value of integers less >> than 101. Personally, I don't particularly like the number 14. I >> changed it to 9 and I am much happier now. > > Okay, you've got me

Re: Python String Immutability Broken!

2008-08-25 Thread Steven D'Aprano
On Mon, 25 Aug 2008 03:43:01 -0700, Ken Seehart wrote: > You can also use ctypes to globally change the value of integers less > than 101. Personally, I don't particularly like the number 14. I > changed it to 9 and I am much happier now. Okay, you've got me curious. How do you do that, and wh

Re: Python String Immutability Broken!

2008-08-25 Thread Ken Seehart
Hendrik van Rooyen wrote: ... Actually, I am not complaining - I am asking for advice on the side effects of what I am doing, which is replacing a bunch of bits in what is essentially an output bit field with the corresponding input bits at the same addresses read back from a simulated i/o bus

Re: Python String Immutability Broken!

2008-08-25 Thread Ken Seehart
You can also use ctypes to globally change the value of integers less than 101. Personally, I don't particularly like the number 14. I changed it to 9 and I am much happier now. I love ctypes. So cool. It's not supposed to be safe. Life is either a daring adventure or nothing. Security

Re: Python String Immutability Broken!

2008-08-25 Thread Simon Brunning
2008/8/25 Hendrik van Rooyen <[EMAIL PROTECTED]>: > It is reputed to belong to a programmer who was flayed alive > by the C.L.P. group, because he had violated the immutability > of a python string. You can indeed use ctypes to modify the value of a string - see . You ca

Re: Python String Immutability Broken!

2008-08-25 Thread Hendrik van Rooyen
Patrick Maupin wrote: >Very entertaining. > Thanks. Nice to see that there is still some sense of humour left somewhere - its all been so serious here lately - people seem to forget that hacking is fun! >But let me get this straight: Are you just complaining that if you >pass a string to an

Re: Python String Immutability Broken!

2008-08-24 Thread Patrick Maupin
On Aug 24, 8:49 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > (a lot of stuff related to using a string with a C library via ctypes) Very entertaining. But let me get this straight: Are you just complaining that if you pass a string to an arbitrary C function using ctypes, that that arb

Re: Python String Immutability Broken!

2008-08-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > It is reputed to belong to a programmer who was flayed alive Reminds me of that great old song from "Saturday Night Hacker": Oh, oh, oh, oh. Flaying alive, flaying alive. Oh, oh, oh, oh. Flaying ali-i-i-i-i-ive! -