Re: [Python-Dev] hash randomization in 3.3

2012-02-22 Thread Stephen J. Turnbull
Antoine Pitrou writes: > How is it a "false sense of security" at all? It's the same as > setting a private secret for e.g. session cookies in Web applications. > As long as you don't leak the seed, it's (should be) secure. That's true. The problem is, the precondition that you won't leak the

Re: [Python-Dev] hash randomization in 3.3

2012-02-22 Thread Terry Reedy
On 2/22/2012 1:57 AM, Nick Coghlan wrote: In the tracker, someone proposed that the option is necessary to synchronize the seed across processes in a cluster. I'm sure people will use it for that if they can. Yeah, that use case sounds reasonable, too. Another example is that, even within a ma

Re: [Python-Dev] hash randomization in 3.3

2012-02-22 Thread Antoine Pitrou
On Wed, 22 Feb 2012 12:59:33 -0500 Barry Warsaw wrote: > On Feb 22, 2012, at 09:04 PM, Stephen J. Turnbull wrote: > > >Brett Cannon writes: > > > > > I think that's inviting trouble if you can provide the seed. It leads to a > > > false sense of security > > > >I thought the point of providing t

Re: [Python-Dev] hash randomization in 3.3

2012-02-22 Thread Barry Warsaw
On Feb 22, 2012, at 09:04 PM, Stephen J. Turnbull wrote: >Brett Cannon writes: > > > I think that's inviting trouble if you can provide the seed. It leads to a > > false sense of security > >I thought the point of providing the seed was for reproducability of >tests and the like? > >As for "false

Re: [Python-Dev] hash randomization in 3.3

2012-02-22 Thread Stephen J. Turnbull
Brett Cannon writes: > I think that's inviting trouble if you can provide the seed. It leads to a > false sense of security I thought the point of providing the seed was for reproducability of tests and the like? As for "false sense", can't we document this and chalk up hubristic behavior to "

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 3:20 PM, wrote: >> I'm with Antoine here - being able to force a particular seed still >> matters for testing purposes. However, the documentation of the option >> may need to be updated for 3.3 to emphasise that it should only be >> used to reproduce sporadic failures. Us

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread martin
I'm with Antoine here - being able to force a particular seed still matters for testing purposes. However, the documentation of the option may need to be updated for 3.3 to emphasise that it should only be used to reproduce sporadic failures. Using it to work around applications that can't cope wi

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Nick Coghlan
On Wed, Feb 22, 2012 at 8:07 AM, Antoine Pitrou wrote: > On Tue, 21 Feb 2012 22:51:48 +0100 > "Martin v. Löwis" wrote: >> On the contrary. PYTHONHASHSEED should go in 3.3, as should any >> facility to disable or otherwise fix the seed. > > Being able to reproduce exact output is useful to chase s

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Antoine Pitrou
On Tue, 21 Feb 2012 22:51:48 +0100 "Martin v. Löwis" wrote: > Am 21.02.2012 20:59, schrieb Antoine Pitrou: > > On Tue, 21 Feb 2012 14:58:41 -0500 > > Benjamin Peterson wrote: > >> 2012/2/21 Antoine Pitrou : > >>> > >>> Hello, > >>> > >>> Shouldn't it be enabled by default in 3.3? > >> > >> Should

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Martin v. Löwis
>> Should you be able to disable it? > > No, but you should be able to provide a seed. Why exactly is that? We should take an attitude that Python hash values are completely arbitrary and can change at any point without notice. The only strict requirement should be that hashing must be consisten

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Martin v. Löwis
Am 21.02.2012 20:59, schrieb Antoine Pitrou: > On Tue, 21 Feb 2012 14:58:41 -0500 > Benjamin Peterson wrote: >> 2012/2/21 Antoine Pitrou : >>> >>> Hello, >>> >>> Shouldn't it be enabled by default in 3.3? >> >> Should you be able to disable it? > > PYTHONHASHSEED=0 should disable it. Do we also

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Barry Warsaw
On Feb 21, 2012, at 09:58 PM, Xavier Morel wrote: >On 2012-02-21, at 21:24 , Brett Cannon wrote: >> On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: >> >>> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: >>> 2012/2/21 Antoine Pitrou : > > Hello, > > Shouldn't it

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Brett Cannon
On Tue, Feb 21, 2012 at 15:58, Xavier Morel wrote: > On 2012-02-21, at 21:24 , Brett Cannon wrote: > > On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: > > > >> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: > >> > >>> 2012/2/21 Antoine Pitrou : > > Hello, > > Shoul

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Xavier Morel
On 2012-02-21, at 21:24 , Brett Cannon wrote: > On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: > >> On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: >> >>> 2012/2/21 Antoine Pitrou : Hello, Shouldn't it be enabled by default in 3.3? >> >> Yes. >> >>> Should you

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Benjamin Peterson
2012/2/21 Antoine Pitrou : > > Hello, > > Shouldn't it be enabled by default in 3.3? I've now enabled it by default in 3.3. -- Regards, Benjamin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsu

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Brett Cannon
On Tue, Feb 21, 2012 at 15:05, Barry Warsaw wrote: > On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: > > >2012/2/21 Antoine Pitrou : > >> > >> Hello, > >> > >> Shouldn't it be enabled by default in 3.3? > > Yes. > > >Should you be able to disable it? > > No, but you should be able to provi

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Glenn Linderman
On 2/21/2012 11:58 AM, Benjamin Peterson wrote: 2012/2/21 Antoine Pitrou: Hello, Shouldn't it be enabled by default in 3.3? Should you be able to disable it? Yes, absolutely. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Barry Warsaw
On Feb 21, 2012, at 02:58 PM, Benjamin Peterson wrote: >2012/2/21 Antoine Pitrou : >> >> Hello, >> >> Shouldn't it be enabled by default in 3.3? Yes. >Should you be able to disable it? No, but you should be able to provide a seed. -Barry ___ Python-D

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Benjamin Peterson
2012/2/21 Antoine Pitrou : > On Tue, 21 Feb 2012 14:58:41 -0500 > Benjamin Peterson wrote: >> 2012/2/21 Antoine Pitrou : >> > >> > Hello, >> > >> > Shouldn't it be enabled by default in 3.3? >> >> Should you be able to disable it? > > PYTHONHASHSEED=0 should disable it.  Do we also need a command-

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Antoine Pitrou
On Tue, 21 Feb 2012 14:58:41 -0500 Benjamin Peterson wrote: > 2012/2/21 Antoine Pitrou : > > > > Hello, > > > > Shouldn't it be enabled by default in 3.3? > > Should you be able to disable it? PYTHONHASHSEED=0 should disable it. Do we also need a command-line option? Regards Antoine.

Re: [Python-Dev] hash randomization in 3.3

2012-02-21 Thread Benjamin Peterson
2012/2/21 Antoine Pitrou : > > Hello, > > Shouldn't it be enabled by default in 3.3? Should you be able to disable it? -- Regards, Benjamin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscrib

[Python-Dev] hash randomization in 3.3

2012-02-21 Thread Antoine Pitrou
Hello, Shouldn't it be enabled by default in 3.3? It's currently disabled. $ ./python -c "print(hash('aa'))" 12416074593111936 [44297 refs] $ ./python -c "print(hash('aa'))" 12416074593111936 [44297 refs] Thanks Antoine. ___ Python-Dev mailing list