summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Iterator support: made the xreadlines object its own iterator. ThisGuido van Rossum2001-05-221-25/+81
| | | | ought to be faster.
* Correct the sense of a couple of conditional compilations -- used #ifndefFred Drake2001-05-221-2/+2
| | | | | | when #ifdef was needed. This closes (reallu!) SF bug #417418.
* Add :method info to the PyArg_ParseTuple() format strings for poll objects.Fred Drake2001-05-211-3/+3
|
* Add warnings to the strop module, for to those functions that reallyGuido van Rossum2001-05-151-0/+22
| | | | | | | | | *are* obsolete; three variables and the maketrans() function are not (yet) obsolete. Add a compensating warnings.filterwarnings() call to test_strop.py. Add this to the NEWS.
* Fix new compiler warnings. Also boost "start" from (C) int to long andTim Peters2001-05-141-5/+5
| | | | | | | | return a (C) long: PyArg_ParseTuple and Py_BuildValue may not let us get at the size_t we really want, but C int is clearly too small for a 64-bit box, and both the start parameter and the return value should work for large mapped files even on 32-bit boxes. The code really needs to be rethought from scratch (not by me, though ...).
* SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen.Tim Peters2001-05-142-13/+13
|
* fcntl.ioctl(): Update error message; necessity noted by Michael Hudson.Fred Drake2001-05-141-1/+3
|
* Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a ↵Mark Hammond2001-05-141-10/+0
| | | | fileobject.h, and initialize it in bltinmodule.
* Fix the .find() method for memory maps.Greg Stein2001-05-141-3/+12
| | | | | | | | | | 1) it didn't obey the "start" parameter (and when it does, we must validate the value) 2) the return value needs to be an absolute index, rather than relative to some arbitrary point in the file (checking CVS, it appears this method never worked; these changes bring it into line with typical .find() behavior)
* Add support for Windows using "mbcs" as the default Unicode encoding when ↵Mark Hammond2001-05-131-40/+99
| | | | dealing with the file system. As discussed on python-dev and in patch 410465.
* Fix a minor style consistency issue.Fred Drake2001-05-111-3/+3
| | | | | | When getting a string buffer for a string we just created, use PyString_AS_STRING() instead of PyString_AsString() to avoid the call overhead and extra type check.
* Include sys/modem.h if we have it; this is needed on HP-UX to provideFred Drake2001-05-111-0/+12
| | | | | | | | constants used by other macros from the headers. Conditionalize VREPRINT and VDISCARD; these are not available on HP-UX. This closes bug #417418.
* Fix the fcntl() docstring so the user is not mis-directed to the FCNTLFred Drake2001-05-101-7/+7
| | | | module for useful constants.
* Guido has Spoken. Restore strop.replace()'s treatment of a 0 count asTim Peters2001-05-101-0/+6
| | | | | | | meaning infinity -- but at least warn about it in the code! I pissed away a couple hours on this today, and don't wish the same on the next in line. Bugfix candidate.
* The strop module and test_strop.py believe replace() with a 0 countTim Peters2001-05-101-1/+1
| | | | | | | means "replace everything". But the string module, string.replace() amd test_string.py believe a 0 count means "replace nothing". "Nothing" wins, strop loses. Bugfix candidate.
* Heh. I need a break. After this: stropmodule & stringobject were moreTim Peters2001-05-101-8/+6
| | | | | | out of synch than I realized, and I managed to break replace's "count" argument when it was 0. All is well again. Maybe. Bugfix candidate.
* Fudge. stropmodule and stringobject both had copies of the buggyTim Peters2001-05-101-8/+13
| | | | | | mymemXXX stuff, and they were already out of synch. Fix the remaining bugs in both and get them back in synch. Bugfix release candidate.
* SF bug #422088: [OSF1 alpha] string.replace().Tim Peters2001-05-091-26/+33
| | | | | | Platform blew up on "123".replace("123", ""). Michael Hudson pinned the blame on platform malloc(0) returning NULL. This is a candidate for all bugfix releases.
* Mechanical changes for easier edits.Tim Peters2001-05-091-152/+136
|
* Modify to allow file objects wherever file descriptors are needed.Fred Drake2001-05-091-8/+71
| | | | | | | | This closes SF bug #231328. Added all constants needed to use the functions defined in this module that are not defined elsewhere (the O_* symbols are available in the os module). No additonal modules are needed to use this now.
* fdconv(): Do not second guess the error condition returned byFred Drake2001-05-091-37/+4
| | | | | | | | PyObject_AsFileDescriptor() -- it does the same thing everywhere, so use it the same way everyone else does so that exceptions are consistent. This means we have less code here, and we do not need to resort to hackish ways of getting the Python-visible function name to fdconv().
* Three uses of makesockaddr() used sockaddr buffers that had not be cleared;Fred Drake2001-05-091-1/+4
| | | | | | | | | | | | | this could cause invalid paths to be returned for AF_UNIX sockets on some platforms (including FreeBSD 4.2-RELEASE), appearantly because there is no assurance that the address will be nul-terminated when filled in by the kernel. PySocketSock_recvfrom(): Use PyString_AS_STRING() to get the data pointer of a string we create ourselves; there is no need for the extra type check from PyString_AsString(). This closes SF bug #416573.
* Minor fiddling related toTim Peters2001-05-091-5/+2
| | | | SF patch 416251 2.1c1 mmapmodule: unused vrbl cleanup
* Only import termio.h on OSF, and add a comment about why it is needed there.Fred Drake2001-05-091-0/+4
| | | | | | | This header does not exist on all Unix flavors; FreeBSD in particular does not include it. This closes SF bug #422320.
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2001-05-071-53/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does several things to termios: (1) changes all functions to be METH_VARARGS (2) changes all functions to be able to take a file object as the first parameter, as per http://mail.python.org/pipermail/python-dev/2001-February/012701.html (3) give better error messages (4) removes a bunch of comments that just repeat the docstrings (5) #includes <termio.h> before #including <sys/ioctl.h> so more #constants are actually #defined. (6) a couple of docstring tweaks I have tested this minimally (i.e. it builds, and doesn't blow up too embarassingly) on OSF1/alpha and on one of the sf compile farm's solaris boxes, and rather more comprehansively on my linux/x86 box. It still needs to be tested on all the other platforms we build termios on. This closes the code portion of SF patch #417081.
* Remove an obsolete comment and a "return" before fallig off the end of aFred Drake2001-05-031-2/+0
| | | | void function.
* ParserCreate(): Allow an empty string for the namespace_separator argument;Fred Drake2001-04-251-68/+82
| | | | | | | | | | | | while not generally a good idea, this is used by RDF users, and works to implement RDF-style namespace+localname concatenation as defined in the RDF specifications. (This also corrects a backwards-compatibility bug.) Be more conservative while clearing out handlers; set the slot in the self->handlers array to NULL before DECREFing the callback. Still more adjustments to make the code style internally consistent.
* SF but #417587: compiler warnings compiling 2.1.Tim Peters2001-04-211-1/+1
| | | | Repaired *some* of the SGI compiler warnings Sjoerd Mullender reported.
* Export three optimization (fast locals) flagsJeremy Hylton2001-04-161-0/+4
|
* Reverting Moshe's EGD patch *and* Martin's patch to make it work withGuido van Rossum2001-04-161-34/+0
| | | | | | | | | | OpenSSL versions beore 0.9.5. This just is too experimental to be worth it, especially since the user would have to do some severe hacking of the Modules/Setup file to even enable the EGD code, and without the EGD code it would always spit out a warning on some systems -- even when socket.ssl() is not used. Fixing that properly is not my job; the EGD patch is clearly not so important that it should hold up the 2.1 release.
* SRE: made "copyright" string static, to avoid potential linkingFredrik Lundh2001-04-151-1/+8
| | | | conflicts.
* Make some private symbols static.Guido van Rossum2001-04-141-1/+1
|
* Clean up the unsightly mess around the readline header files. We nowGuido van Rossum2001-04-131-24/+1
| | | | | | | | | | | | | | | | | | | | | | | always: - #undef HAVE_CONFIG_H (because otherwise chardefs.h tries to include strings.h) - #include readline.h and history.h and we never declare any readline function prototypes ourselves. This makes it compile with readline 4.2, albeit with a few warnings. Some of the remaining warnings are about completion_matches(), which is renamed to rl_completion_matches(). I've tested it with various other versions, from 2.0 up, and they all seem to work (some with warnings) -- but only on Red Hat Linux 6.2. Fixing the warnings for readline 4.2 would break compatibility with 3.0 (and maybe even earlier versions), and readline doesn't seem to have a way to test for its version at compile time, so I'd rather leave the warnings in than break compilation with older versions.
* I am TENTATIVELY checking in Martin von Loewis's patch for the SSLGuido van Rossum2001-04-131-0/+7
| | | | | | | | | | | | problem reported by Neil Schemenauer on python-dev on 4/12/01, wth subject "Problem with SSL and socketmodule on Debian Potato?". It's tentative because Moshe objected, but Martin rebutted, and Moshe seems unavailable for comments. (Note that with OpenSSL 0.9.6a, I get a lot of compilation warnings for socketmodule.c -- I'm assuming I can safely ignore these until 2.1 is released.)
* cleanup_helper(): Make sure we invalidate all reference objectsFred Drake2001-04-131-6/+41
| | | | | | | | | | | before calling any callbacks. This is important since the callback objects only look at themselves to determine that they are invalide. This change avoids a segfault when callbacks use a different reference to an object in the process of being deallocated. This fixes SF bug #415660.
* Slight adaptation of Michael Hudson's patch to test PyDict_Next()Guido van Rossum2001-04-131-0/+62
| | | | | | | | | | | | (with modification of existing dict elements!). This is part of SF patch #409864: lazy fix for Pings bizarre scoping crash. The adaptation I made to Michael's patch was to change the error handling to avoid masking other errors (moving the specific error message to inside test_dict_inner()), and to insert a test for dict==NULL at the start.
* Unixware 7 support by Billy G. Allie (SF patch 413011)Guido van Rossum2001-04-112-0/+34
|
* Updated version of RISCOS support. SF patch 411213 by Dietmar SchwertbergerGuido van Rossum2001-04-102-10/+22
|
* Include py_curses.h *after* defining _XOPEN_SOURCE_EXTENDED.Guido van Rossum2001-04-101-2/+3
| | | | | | Michael Hudson suggested this fox for the Tru64 problem (SF bug 232597). It looks reasonable, it works on Tru64, and it doesn't beak anything on Linux, so I say go for it.
* Ack -- this module mixes tabs and spaces, and what appears to be a mixTim Peters2001-04-101-5/+5
| | | | | | | of 2-space and 4-space indents. Whatever, when I saw the checkin diff it was clear that what my editor thinks a tab means didn't match this module's belief. Removed all the tabs from the lines I added and changed, left everything else alone.
* On a sizeof(long)==8 machine, ints in range(2**31, 2**32) were gettingTim Peters2001-04-101-5/+21
| | | | | | | | | | | | | | | | pickled into the signed(!) 4-byte BININT format, so were getting unpickled again as negative ints. Repaired that. Added some minimal docs at the top about what I've learned about the pickle format codes (little of which was obvious from staring at the code, although that's partly because all the size-related bugs greatly obscured the true intent of the code). Happy side effect: because save_int() needed to grow a *proper* range check in order to fix this bug, it can now use the more-efficient BININT1, BININT2 and BININT formats when the long's value is small enough to fit in a signed 4-byte int (before this, on a sizeof(long)==8 box it always used the general INT format for negative ints). test_cpickle works again on sizeof(long)==8 machines. test_pickle is still busted big-time.
* Critical fix: if cPickle on a sizeof(long)==8 box is used to read aTim Peters2001-04-101-1/+8
| | | | | | | | | | | binary pickle, and the latter contains a pickle of a negative Python int i written on a sizeof(long)==4 box (and whether by cPickle or pickle.py), it's read incorrectly as i + 2**32. The patch repairs that, and allows test_cpickle.py (to which I added a relevant test case earlier today) to work again on sizeof(long)==8 boxes. There's another (at least one) sizeof(long)==8 binary pickle bug, but in pickle.py instead. That bug is still there, and test_pickle.py doesn't catch it yet (try pickling and unpickling, e.g., 1 << 46).
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2001-04-091-13/+10
| | | | | | | Update the docstrings to no longer refer to the obsolete TERMIOS module. This is a partial acceptance of SF patch #413419.
* Repair portability of sign extension when reading signed ints on boxesTim Peters2001-04-081-10/+6
| | | | | | | | | | where sizeof(long)==8. This *was* broken on boxes where signed right shifts didn't sign-extend, but not elsewhere. Unfortunately, apart from the Cray T3E I don't know of such a box, and Guido has so far refused to buy me any Cray machines for home Python testing <wink>. More immediately interesting would be if someone could please test this on *any* sizeof(long)==8 box, to make sure I didn't break it.
* Effectively revert the previous change: leave the new #include in, butFred Drake2001-04-051-0/+3
| | | | | comment it out with an explanation. This makes it easier for someone who wants the additional symbols to try re-enabling it for their platform.
* Add an #include of sys/ioctl.h to pick up a lot of the constants supportedFred Drake2001-04-041-0/+1
| | | | | | in the previous patch. This closes (again!) SF patch #410267.
* Applying SF patch #412553 by Christopher Lee: fix linuxaudiodevGuido van Rossum2001-04-021-9/+29
| | | | | | | | | | handling of EAGAIN. This may or may not fix the problem for me (Mandrake 7.2 on a Dell Optiplex GX110 desktop): I can't hear the output, but it does pass the test now. It doesn't fix the problem for Fred (Mandrake 7.2 on a Dell Inspiron 7500 which has the Maestro sound drivers). Fred suspects that it's the kernel version in combination with the driver.
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2001-03-261-0/+329
| | | | | | Add many more constants for some systems. This closes SF patch #410267.
* get_version_string(): New function -- returns a Python string object thatFred Drake2001-03-241-3/+24
| | | | | | | | gives the CVS revision of this file even if it does not include the extra RCS "$Revision: " cruft. initpyexpat(): Use get_version_string() instead of hard-coding magic indexes into the RCS string (which may be affected by export options).
* Fix a memory leak -- there's no need to INCREF() the result ofGuido van Rossum2001-03-231-1/+0
| | | | newreadlinesobject() in xreadlines().