summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Fix non-blocking connect() for Windows. Refactored the codeGuido van Rossum2002-06-131-27/+40
| | | | | | | | | | | that retries the connect() call in timeout mode so it can be shared between connect() and connect_ex(), and needs only a single #ifdef. The test for this was doing funky stuff I don't approve of, so I removed it in favor of a simpler test. This allowed me to implement a simpler, "purer" form of the timeout retry code. Hopefully that's enough (if you want to be fancy, use non-blocking mode and decode the errors yourself, like before).
* Major overhaul of timeout sockets:Guido van Rossum2002-06-132-222/+60
| | | | | | | | | | | | | | | | | | | | - setblocking(0) and settimeout(0) are now equivalent, and ditto for setblocking(1) and settimeout(None). - Don't raise an exception from internal_select(); let the final call report the error (this means you will get an EAGAIN error instead of an ETIMEDOUT error -- I don't care). - Move the select to inside the Py_{BEGIN,END}_ALLOW_THREADS brackets, so other theads can run (this was a bug in the original code). - Redid the retry logic in connect() and connect_ex() to avoid masking errors. This probably doesn't work for Windows yet; I'll fix that next. It may also fail on other platforms, depending on what retrying a connect does; I need help with this. - Get rid of the retry logic in accept(). I don't think it was needed at all. But I may be wrong.
* _Py prefix is verboten for static entry pointsAndrew MacIntyre2002-06-131-4/+4
|
* work around name clash with OS/2 TCPIP routine sock_init()Andrew MacIntyre2002-06-131-2/+2
|
* patch #562492 - prevent duplicate lines in historySkip Montanaro2002-06-111-2/+19
| | | | also call using_history() to properly initialize history variables
* Patch #488073: AtheOS port.Martin v. Löwis2002-06-111-1/+3
|
* Don't accept null bytes in the key.Guido van Rossum2002-06-101-2/+1
|
* SF bug 563750 (Alex Martelli): posix_tmpfile():Guido van Rossum2002-06-101-1/+1
| | | | | | | The file returned by tmpfile() has mode w+b, so use that in the call to PyFile_FromFile(). Bugfix candidate.
* Move the conex_finally label up, so that the errno value is alwaysGuido van Rossum2002-06-071-1/+1
| | | | returned.
* I decided to change the interaction between setblocking() andGuido van Rossum2002-06-071-5/+2
| | | | | | | | | | 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.)
* Major cleanup. Renamed static methods to avoid Py prefix. Other miscGuido van Rossum2002-06-071-296/+290
| | | | cleanup as well, e.g. renamed NTinit to os_init.
* Repair a comment.Guido van Rossum2002-06-071-1/+1
|
* Whitespace normalization, folding long lines, uniform commentGuido van Rossum2002-06-071-224/+229
| | | | delimiters. Also repaired some docstrings and comments.
* Correct several blunders in the timeout code, mostly my own fault (forGuido van Rossum2002-06-071-14/+12
| | | | | | | | | | | | | | | | | | | | | 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.
* Remove casts to PyObject * when declaration is for PyObject *Jeremy Hylton2002-06-061-3/+3
|
* SF patch 555085 (timeout socket implementation) by Michael Gilfix.Guido van Rossum2002-06-062-54/+423
| | | | | | | | | | | | | 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. :-)
* The insint() function is not used. Nuke it.Guido van Rossum2002-06-061-15/+0
|
* The tp_new implementation should initialize the errorhandler field,Guido van Rossum2002-06-061-1/+3
| | | | | | | | otherwise this code could segfault: from socket import socket s = socket.__new__(socket) s.recv(100)
* Fix SF bug #557436, TclError is a str should be an ExceptionNeal Norwitz2002-06-041-1/+1
| | | | Make Tkinter.TclError derive from Exception, it was a string.
* Remove unused static functionNeal Norwitz2002-05-311-19/+0
|
* SF #558432: Prevent Annoying ' ' from readline (Holker Krekel).Guido van Rossum2002-05-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | readline in all python versions is configured to append a 'space' character for a successful completion. But for almost all python expressions 'space' is not wanted (see coding conventions PEP 8). For example if you have a function 'longfunction' and you type 'longf<TAB>' you get 'longfunction ' as a completion. note the unwanted space at the end. The patch fixes this behaviour by setting readline's append_character to '\0' which means don't append anything. This doesn't work with readline < 2.1 (AFAIK nowadays readline2.2 is in good use). An alternative approach would be to make the append_character accessable from python so that modules like the rlcompleter.py can set it to '\0'. [Ed.: I think expecting readline >= 2.2 is fine. If a completer wants another character they can append that to the keyword in the list.]
* The logreader object did not always refill the input buffer correctlyNeil Schemenauer2002-05-291-105/+56
| | | | | and got confused by certain log files. Remove logreader_refill and the associated logic and replace with fgetc.
* Issue an explicit error when we can't find an appropriate type forGuido van Rossum2002-05-291-0/+2
| | | | UINT4.
* This is patchMichael W. Hudson2002-05-291-7/+3
| | | | | | | [ 558914 ] Build md5.c fails on Cray T3E I've also deleted a comment that I didn't understand. Feel free to put it back if it makes/made sense to you.
* This is patchMichael W. Hudson2002-05-271-0/+171
| | | | | | | [ 559250 ] more POSIX signal stuff Adds support (and docs and tests and autoconfery) for posix signal mask handling -- sigpending, sigprocmask and sigsuspend.
* Disambiguate the grammar for backtick.Guido van Rossum2002-05-241-1/+13
| | | | | | The old syntax suggested that a trailing comma was OK inside backticks, but in fact (due to ideosyncrasies of pgen) it was not. Fix the grammar to avoid the ambiguity. Fred: you may want to update the refman.
* Whitespace normalization.Tim Peters2002-05-231-7/+7
|
* Add IS_TRACKED and IS_MOVED macros. This makes the logic a little more clear.Neil Schemenauer2002-05-211-7/+10
|
* array_tounicode isn't defined in --disable-unicode builds...Michael W. Hudson2002-05-131-0/+4
| | | | | I have a patch to make the test work too, but it's not pretty so I'll submit it to sf.
* Added degrees() and radians() to mathmodule. Closes patch 552452 andRaymond Hettinger2002-05-131-0/+27
| | | | feature request 426539.
* Patch #551011: Fix compilation problems with Cygwin.Martin v. Löwis2002-05-081-1/+1
|
* Rename posix_WCONTINUED to posix_WIFCONTINUED, call WIFCONTINUED inside,Martin v. Löwis2002-05-041-2/+5
| | | | add it to the posix_methods.
* Move all data for a single generation into a structure. The set ofNeil Schemenauer2002-05-041-73/+97
| | | | | | | | | | | | generations is now an array. This cleans up some code and makes it easy to change the number of generations. Also, implemented a gc_list_is_empty() function. This makes the logic a little clearer in places. The performance impact of these changes should be negligible. One functional change is that allocation/collection counters are always zeroed at the start of a collection. This should fix SF bug #551915. This change is too big for back-porting but the minimal patch on SF looks good for a bugfix release.
* Indicate delayed initialization of slots. Suggested by tim.one.Martin v. Löwis2002-05-021-3/+5
|
* Patch #551009: Initialize array type dynamically.Martin v. Löwis2002-05-021-3/+6
|
* Guard gettext and friends with HAVE_LIBINTL_H. Fixes #549907.Martin v. Löwis2002-05-021-1/+1
|
* Pickler_clear_memo(): convert to METH_NOARGS.Fred Drake2002-05-011-5/+2
|
* See discussion at SF bug 547537.Guido van Rossum2002-04-291-1/+1
| | | | | | | | | | | Unicode objects are currently taken as binary data by the write() method. This is not what Unicode users expect, nor what the StringIO.py code does. Until somebody adds a way to specify binary or text mode for cStringIO objects, change the format string to use "t#" instead of "s#", so that it will request the "text buffer" version. This will try the default encoding for Unicode objects. This is *not* a 2.2 bugfix (since it *is* a semantic change).
* _PyObject_GC_New: Could call PyObject_INIT with a NULL 1st argument.Tim Peters2002-04-281-2/+6
| | | | | | _PyObject_GC_NewVar: Could call PyObject_INIT_VAR likewise. Bugfix candidate.
* Repair widespread misuse of _PyString_Resize. Since it's clear peopleTim Peters2002-04-279-55/+23
| | | | | | | | | | | | | | | | | | | | | | don't understand how this function works, also beefed up the docs. The most common usage error is of this form (often spread out across gotos): if (_PyString_Resize(&s, n) < 0) { Py_DECREF(s); s = NULL; goto outtahere; } The error is that if _PyString_Resize runs out of memory, it automatically decrefs the input string object s (which also deallocates it, since its refcount must be 1 upon entry), and sets s to NULL. So if the "if" branch ever triggers, it's an error to call Py_DECREF(s): s is already NULL! A correct way to write the above is the simpler (and intended) if (_PyString_Resize(&s, n) < 0) goto outtahere; Bugfix candidate.
* Check for overflow errors in setrlimit(),Jeremy Hylton2002-04-231-1/+10
| | | | and reflow a long line.
* WCOREDUMP(), WIFCONTINUED(), WCONTINUED, WUNTRACED: New.Fred Drake2002-04-231-11/+75
| | | | | isatty(), WIFEXITED(), WIFSIGNALED(), WIFSTOPPED(): Changed to return bools instead of ints.
* SF patch [ 545523 ] patch for 514433 bsddb.dbopen (NULL)Anthony Baxter2002-04-231-3/+3
| | | | | | | | | | | | closes SF #514433 can now pass 'None' as the filename for the bsddb.*open functions, and you'll get an in-memory temporary store. docs are ripped out of the bsddb dbopen man page. Fred may want to clean them up. Considering this for 2.2, but not 2.1.
* #546156, Remove load_false()/load_true(), they are not usedNeal Norwitz2002-04-211-14/+0
|
* #544265, Remove warnings for passing const to free()Neal Norwitz2002-04-211-1/+1
|
* #546163, fix link problem on Solaris 8 for makedev when using mknodNeal Norwitz2002-04-201-0/+3
|
* Forward port of patch # 500311: Work around for buggy https servers.Martin v. Löwis2002-04-201-24/+72
| | | | Fixes #494762.
* Patch #546194: Check constants individually. Fixes 534143 on OpenBSD.Martin v. Löwis2002-04-191-2/+19
| | | | Will backport to 2.2.
* #546155, remove posix_int() it is not usedNeal Norwitz2002-04-191-16/+0
|
* Fix SF #544995 (zlib crash on second flush call)Jeremy Hylton2002-04-191-0/+1
| | | | | | Bug fix by mhammond. Bug fix candidate for 2.2, not present in 2.1.