This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: asyncore sillies
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: anthonybaxter, mwh, tim.peters
Priority: high Keywords:

Created on 2004-06-11 15:19 by mwh, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg21142 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-06-11 15:19
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.
msg21143 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-06-11 15:58
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?
msg21144 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-06-11 16:47
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.
msg21145 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-06-11 17:03
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.
msg21146 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2004-06-12 17:35
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.
msg21147 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-06-13 02:40
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
msg21148 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-06-14 10:36
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.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40384
2004-06-11 15:19:06mwhcreate