[ python-Bugs-971200 ] asyncore sillies

SourceForge.net noreply at sourceforge.net
Mon Jun 14 06:36:09 EDT 2004


Bugs item #971200, was opened at 2004-06-11 16:19
Message generated for change (Comment added) made by mwh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=971200&group_id=5470

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 7
Submitted By: Michael Hudson (mwh)
Assigned to: Nobody/Anonymous (nobody)
Summary: asyncore sillies

Initial Comment:
current cvs head, mac os x 10.2, debug build of python.

test_asynchat fails if and only if the compiled asyncore.pyc 
file is present.

this makes no sense to me, but it's consistent.

----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2004-06-14 11:36

Message:
Logged In: YES 
user_id=6656

I think this can be closed now.  A half-assed test could be
added to marshal (if (x!=x) PyErr_SetString(...)) but I'm
not sure it's worth it.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2004-06-13 03:40

Message:
Logged In: YES 
user_id=31435

marshal doesn't know whether the input is an infinity; that's 
why the result is a platform-dependent accident; "infinity" 
isn't a C89 concept, and Python inherits its ignorance from C

----------------------------------------------------------------------

Comment By: Anthony Baxter (anthonybaxter)
Date: 2004-06-12 18:35

Message:
Logged In: YES 
user_id=29957

Is it worth making marshal issue a warning when someone
tries to store an infinity, in that case? It could (ha!) be
suprising that a piece of code that works from a .py fails
silently from a .pyc.


----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2004-06-11 18:03

Message:
Logged In: YES 
user_id=6656

actually, i think the summary is that the most recent change to 
asyncore is just broken.  blaming the recent changes around 
LC_NUMERIC and their effect or non-effect on marshal was a read 
herring.

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2004-06-11 17:47

Message:
Logged In: YES 
user_id=31435

Well, what marshal (or pickle) do with an infinity (or NaN, or 
the sign of a signed zero) is a platform accident.  Here with 
the released 2.3.4 on Windows (which doesn't have any 
LC_NUMERIC changes):

Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more 
information.
>>> 1e309
1.#INF
>>> import marshal
>>> marshal.loads(marshal.dumps(1e309))
1.0
>>>

So simply can't use a literal 1e309 in compiled code.  There's 
no portable way to spell infinity in Python.  PEP 754 would 
introduce a reasonably portable way, were it accepted.  
Before then, 1e200*1e200 is probably the easiest reasonably 
portable way -- but since behavior in the presence of an 
infinity is accidental anyway, much better to avoid using 
infinity at all in the libraries.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2004-06-11 16:58

Message:
Logged In: YES 
user_id=6656

Oh my:

>>> 1e309
Inf
[40577 refs]
>>> marshal.loads(marshal.dumps(1e309))
0.0
[40577 refs]

this must be the new "LC_NUMERIC agnostic" stuff, right?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=971200&group_id=5470



More information about the Python-bugs-list mailing list