Commit Graph

22687 Commits

Author SHA1 Message Date
Guido van Rossum e8008f0013 I decided to change the interaction between setblocking() and
settimeout().   Already, settimeout() canceled non-blocking mode; now,
setblocking() also cancels the timeout.  This is easier to document.

(XXX should settimeout(0) be an alias for setblocking(0)?  They seem
to have roughly the same effect.  Also, I'm not sure that the code in
connect() and accept() is correct in all cases.  We'll sort this out
soon enough.)
2002-06-07 03:36:20 +00:00
Skip Montanaro 96803b2983 gnu_getopt should be exported in __all__ 2002-06-07 03:26:43 +00:00
Guido van Rossum c4fcfa3457 Major cleanup. Renamed static methods to avoid Py prefix. Other misc
cleanup as well, e.g. renamed NTinit to os_init.
2002-06-07 03:19:37 +00:00
Guido van Rossum be8db07ab5 Repair a comment. 2002-06-07 02:27:50 +00:00
Guido van Rossum 3eede5ad81 Whitespace normalization, folding long lines, uniform comment
delimiters.  Also repaired some docstrings and comments.
2002-06-07 02:08:35 +00:00
Guido van Rossum b9e916a0b5 Correct several blunders in the timeout code, mostly my own fault (for
not testing it -- apparently test_timeout.py doesn't test anything
useful):

In internal_select():

- The tv_usec part of the timeout for select() was calculated wrong.

- The first argument to select() was one too low.

- The sense of the direction argument to internal_select() was
  inverted.

In PySocketSock_settimeout():

- The calls to internal_setblocking() were swapped.

Also, repaired some comments and fixed the test for the return value
of internal_select() in sendall -- this was in the original patch.
2002-06-07 01:42:47 +00:00
Jeremy Hylton 8a13518d25 Remove casts to PyObject * when declaration is for PyObject * 2002-06-06 23:23:55 +00:00
Neal Norwitz bdbd84fdac Add version info, and fix another typo and wording spotted by /F. I think this is what he meant. :-) 2002-06-06 22:24:10 +00:00
Fred Drake 1a06fb0605 Fix typo spotted by Fredrik Lundh. 2002-06-06 22:19:20 +00:00
Fred Drake 6c6d662760 Fix some markup errors and adjust wording slightly. 2002-06-06 21:57:48 +00:00
Guido van Rossum be946bfea7 SF patch 555085 (timeout socket implementation) by Michael Gilfix.
I've made considerable changes to Michael's code, specifically to use
the select() system call directly and to store the timeout as a C
double instead of a Python object; internally, -1.0 (or anything
negative) represents the None from the API.

I'm not 100% sure that all corner cases are covered correctly, so
please keep an eye on this.  Next I'm going to try it Windows before
Tim complains.

No way is this a bugfix candidate. :-)
2002-06-06 21:51:01 +00:00
Guido van Rossum 15699055e9 Michael Gilfix of SF patch 555085 fame. 2002-06-06 21:08:46 +00:00
Guido van Rossum 67f7a38849 SF patch 555085 (timeout socket implementation) by Michael Gilfix.
I've made considerable changes to Michael's code, specifically to use
the select() system call directly and to store the timeout as a C
double instead of a Python object; internally, -1.0 (or anything
negative) represents the None from the API.

I'm not 100% sure that all corner cases are covered correctly, so
please keep an eye on this.  Next I'm going to try it Windows before
Tim complains.

No way is this a bugfix candidate. :-)
2002-06-06 21:08:16 +00:00
Guido van Rossum c9a55776c8 The insint() function is not used. Nuke it. 2002-06-06 20:41:10 +00:00
Guido van Rossum e1c478ff8a The tp_new implementation should initialize the errorhandler field,
otherwise this code could segfault:

  from socket import socket
  s = socket.__new__(socket)
  s.recv(100)
2002-06-06 20:08:25 +00:00
Neal Norwitz a312c3ade7 Remove uses of string module and stat.ST_MODE 2002-06-06 18:30:10 +00:00
Neal Norwitz ec7cf1382b Remove another reference to stat.ST_MODE 2002-06-06 18:16:14 +00:00
Martin v. Löwis 33b77de106 Use isinstance for the type check, use booleans. 2002-06-06 18:14:50 +00:00
Guido van Rossum a48cb8f77d Fix from SF patch 565085: copy._reduction doesn't __setstate__.
Straightforward fix.  Will backport to 2.2.  If there's ever a new 2.1
release, this could be backported there too (since it's an issue with
anything that's got both a __reduce__ and a __setstate__).
2002-06-06 17:53:03 +00:00
Guido van Rossum 3e3583c345 Fix from SF patch 565085: copy._reduction doesn't __setstate__.
Straightforward fix.  Will backport to 2.2.  If there's ever a new 2.1
release, this could be backported there too (since it's an issue with
anything that's got both a __reduce__ and a __setstate__).
2002-06-06 17:41:20 +00:00
Walter Dörwald 88a20baa77 Apply diff.txt from SF patch http://www.python.org/sf/561478
This uses cgi.parse_header() in Checker.checkforhtml(), so that
webchecker recognises the mime type text/html even if options
are specified.
2002-06-06 17:01:21 +00:00
Raymond Hettinger 478d47a168 Close SF bug 563740. complex() now finds __complex__() in new style classes.
Made conversion failure error messages consistent between types.
Added related unittests.
2002-06-06 15:45:38 +00:00
Neal Norwitz 56f46f8d8c Pyrangeiter_Type && range_iter should be static 2002-06-06 14:58:21 +00:00
Jeremy Hylton a683233d87 Change warning to debug level; it's a very minor issue.
The specific warning is that clean didn't find a directory that should
be removed if it exists.
2002-06-06 14:54:56 +00:00
Michael W. Hudson 065c1a25d1 Stop testing for sigprocmask. This is a stop gap measure until I work
out how to just activate my code on platforms where I know it works
(currently only linux/x86).
2002-06-06 13:03:44 +00:00
Martin v. Löwis 446a25fa3c Patch 473512: add GNU style scanning as gnu_getopt. 2002-06-06 10:58:36 +00:00
Martin v. Löwis cdbc131f03 Patch #551911: Escape . properly. 2002-06-06 09:52:49 +00:00
Walter Dörwald 294bbf3a59 Replace obsolete stat module constants with
equivalent attributes in a few more spots.

This closes SF patch http://www.python.org/sf/562373
2002-06-06 09:48:13 +00:00
Guido van Rossum c2009a8666 CRLF -> LF 2002-06-06 00:44:16 +00:00
Raymond Hettinger c4c453f5ae Skip Montanaro's patch, SF 559833, exposing xrange type in builtins.
Also, added more regression tests to cover the new type and test its
conformity with range().
2002-06-05 23:12:45 +00:00
Piers Lauder f97b2d7dad open method changed to use arguments and set instance host/port values (instead of __init__) 2002-06-05 22:31:57 +00:00
Raymond Hettinger 48165d40cb SF 564601 adding rangeiterobject to make xrange() iterate like range(). 2002-06-05 20:08:48 +00:00
Guido van Rossum d842e07470 SF bug 558179.
Change default for get() back to None.
Will backport to 2.2.1.
2002-06-05 19:07:39 +00:00
Just van Rossum 84fca948c8 fixed refcount leak in CreateNewWindow() and CreateWindowFromResource(). 2002-06-05 17:41:03 +00:00
Thomas Heller aee2d5f975 Better isinstance error message.
Closes SF patch # 560250.

Bugfix candidate IMO.
2002-06-05 12:55:19 +00:00
Jeremy Hylton dc8412e541 Move warning about directory not on sys.path to debug level.
Fix a bunch of multiline string constants that used +.
2002-06-04 21:20:08 +00:00
Jeremy Hylton 8f787bf1d0 Test changes before checking them in. 2002-06-04 21:11:56 +00:00
Jeremy Hylton 40ebbeff23 Track extra arg to option_table to all uses of it 2002-06-04 21:10:35 +00:00
Jeremy Hylton 6b3996b2b9 Replace bogus bare variables with attribute access. 2002-06-04 21:06:16 +00:00
Jeremy Hylton 115fdc614f Define DEBUG as early as possible to avoid import problems. 2002-06-04 21:05:05 +00:00
Jeremy Hylton 4f2f1335a8 Add missing import of log. 2002-06-04 21:04:03 +00:00
Jeremy Hylton 7146073850 Use module-level import of DEBUG instead of many function-level imports. 2002-06-04 21:02:26 +00:00
Jeremy Hylton fc861bab92 Remove unused imports 2002-06-04 21:00:33 +00:00
Jeremy Hylton 11a52708f7 Make None return explicit 2002-06-04 21:00:20 +00:00
Jeremy Hylton c58e984837 import base64 at the top to avoid two different imports at other times 2002-06-04 20:55:10 +00:00
Jeremy Hylton ec772744c7 ensure_filename() only takes one argument.
Call ensure_string() with one arg too, since the second value passed
was the default.
2002-06-04 20:45:17 +00:00
Jeremy Hylton adb2b38543 Reindent lines to improve readability 2002-06-04 20:42:41 +00:00
Jeremy Hylton 711f91cf83 Remove (commented out) options that have moved into the distribution. 2002-06-04 20:40:03 +00:00
Jeremy Hylton d003abccc7 get_script() implicitly returned None and also had explicit returns.
Make all returns explicit and rearrange logic to avoid extra
indentation.
2002-06-04 20:39:34 +00:00
Jeremy Hylton d53f6e43e7 global _option_order is not used 2002-06-04 20:35:10 +00:00