Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Alex Martelli
On Apr 10, 2005, at 13:44, Skip Montanaro wrote: Michael> I suppose one could jsut do it unconditionally and wait for one Michael> of the three remaining VAX users[2] to compile Python 2.5 and Michael> then notice. You forgot the two remaining CRAY users. Since their machines are so

Re: [Python-Dev] threading (GilState) question

2005-04-10 Thread Bob Ippolito
On Apr 10, 2005, at 4:08 PM, Michael Hudson wrote: Bob Ippolito <[EMAIL PROTECTED]> writes: On Apr 10, 2005, at 2:48 PM, Michael Hudson wrote: James Y Knight <[EMAIL PROTECTED]> writes: Here's the numbers. It looks like something changed between python 2.2 and 2.3 that made calling PyEval_InitThre

Re: [Python-Dev] threading (GilState) question

2005-04-10 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes: > On Apr 10, 2005, at 2:48 PM, Michael Hudson wrote: > >> James Y Knight <[EMAIL PROTECTED]> writes: >> >>> Here's the numbers. It looks like something changed between python 2.2 >>> and 2.3 that made calling PyEval_InitThreads a lot less expensive. So, >>>

Re: [Python-Dev] Re: Re: marshal / unmarshal

2005-04-10 Thread Tim Peters
[Fredrik Lundh] > is changing the marshal format really the right thing to do at this > point? I don't see anything special about "this point" -- it's just sometime between 2.4.1 and 2.5a0. What do you have in mind? Like pickle formats, I expect a change to marshal would add a new format code, n

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Tim Peters
[mwh] > OTOH, the implementation has this comment: > > /* > * _PyFloat_{Pack,Unpack}{4,8}. See floatobject.h. > * > * TODO: On platforms that use the standard IEEE-754 single and double > * formats natively, these routine

Re: [Python-Dev] threading (GilState) question

2005-04-10 Thread Bob Ippolito
On Apr 10, 2005, at 2:48 PM, Michael Hudson wrote: James Y Knight <[EMAIL PROTECTED]> writes: On Apr 10, 2005, at 11:22 AM, Michael Hudson wrote: Bob Ippolito <[EMAIL PROTECTED]> writes: Is there a good reason to *not* call PyEval_InitThreads when using a threaded Python? Well, it depends how expen

Re: [Python-Dev] threading (GilState) question

2005-04-10 Thread Michael Hudson
James Y Knight <[EMAIL PROTECTED]> writes: > On Apr 10, 2005, at 11:22 AM, Michael Hudson wrote: > >> Bob Ippolito <[EMAIL PROTECTED]> writes: >> >>> Is there a good reason to *not* call PyEval_InitThreads when using a >>> threaded Python? >> >> Well, it depends how expensive ones OS's locking pri

Re: [Python-Dev] threading (GilState) question

2005-04-10 Thread James Y Knight
On Apr 10, 2005, at 11:22 AM, Michael Hudson wrote: Bob Ippolito <[EMAIL PROTECTED]> writes: Is there a good reason to *not* call PyEval_InitThreads when using a threaded Python? Well, it depends how expensive ones OS's locking primitives are, I think. There were some numbers posted to the twisted

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Skip Montanaro
Michael> I suppose one could jsut do it unconditionally and wait for one Michael> of the three remaining VAX users[2] to compile Python 2.5 and Michael> then notice. You forgot the two remaining CRAY users. Since their machines are so much more powerful than VAXen, they have much mor

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Michael Hudson
Tim Peters <[EMAIL PROTECTED]> writes: > marshal shouldn't be representing doubles as decimal strings to begin > with. All code for (de)serialing C doubles should go thru > _PyFloat_Pack8() and _PyFloat_Unpack8(). cPickle (proto >= 1) and > struct (std mode) already do; marshal is the oddball. >

[Python-Dev] Re: Re: marshal / unmarshal

2005-04-10 Thread Fredrik Lundh
Tim Peters wrote: > marshal shouldn't be representing doubles as decimal strings to begin > with. All code for (de)serialing C doubles should go thru > _PyFloat_Pack8() and _PyFloat_Unpack8(). cPickle (proto >= 1) and > struct (std mode) already do; marshal is the oddball. is changing the marsh

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Tim Peters
marshal shouldn't be representing doubles as decimal strings to begin with. All code for (de)serialing C doubles should go thru _PyFloat_Pack8() and _PyFloat_Unpack8(). cPickle (proto >= 1) and struct (std mode) already do; marshal is the oddball. But as the docs (floatobject.h) for these say:

Re: [Python-Dev] Security capabilities in Python

2005-04-10 Thread Eyal Lotem
It may be really hard to get it right, unless we are overlooking some simple solution.I disagree that we should "just use OS protections".The reason I am interested in Pythonic protection is because it is so much more powerful than OS protections.  The capability model is much more powerful than th

Re: [Python-Dev] Security capabilities in Python

2005-04-10 Thread Michael Hudson
James Y Knight <[EMAIL PROTECTED]> writes: > On Apr 9, 2005, at 2:13 PM, Michael Hudson wrote: > >> The funniest I know is part of PyPy: >> >> def extract_cell_content(c): >> """Get the value contained in a CPython 'cell', as read through >> the func_closure of a function object.""" >>

[Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Fredrik Lundh
Scott David Daniels wrote: > From yesterday's sprint sprint? I was beginning to wonder why nobody cared about this; guess I missed the announcement ;-) > At the least a change like this will catch the unpacking: > in marshal.c (around line 500) in function r_object: > PyFPE_START_PROTECT("ato

Re: [Python-Dev] threading (GilState) question

2005-04-10 Thread Michael Hudson
Bob Ippolito <[EMAIL PROTECTED]> writes: > Is there a good reason to *not* call PyEval_InitThreads when using a > threaded Python? Well, it depends how expensive ones OS's locking primitives are, I think. There were some numbers posted to the twisted list recently that showed it didn't make a wh

[Python-Dev] Re: marshal / unmarshal

2005-04-10 Thread Scott David Daniels
Fredrik Lundh wrote: pickle doesn't have the INF=>1.0 bug: import pickle pickle.loads(pickle.dumps(1e1)) ... ValueError: invalid literal for float(): 1.#INF import cPickle cPickle.loads(cPickle.dumps(1e1)) ... ValueError: could not convert string to float import marshal marshal.loads(marsha