summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Squash compiler wng about signed-vs-unsigned mismatch.Tim Peters2003-03-211-1/+1
|
* add _csv build lineSkip Montanaro2003-03-201-0/+3
|
* new CSV file processing module - see PEP 305Skip Montanaro2003-03-201-0/+1465
|
* New private API functions _PyFloat_{Pack,Unpack}(4,8}. This is aTim Peters2003-03-202-446/+27
| | | | | refactoring to get all the duplicates of this delicate code out of the cPickle and struct modules.
* SF bug 705836: struct.pack of floats in non-native endian orderTim Peters2003-03-202-18/+61
| | | | | | | | | | | | | | pack_float, pack_double, save_float: All the routines for creating IEEE-format packed representations of floats and doubles simply ignored that rounding can (in rare cases) propagate out of a long string of 1 bits. At worst, the end-off carry can (by mistake) interfere with the exponent value, and then unpacking yields a result wrong by a factor of 2. In less severe cases, it can end up losing more low-order bits than intended, or fail to catch overflow *caused* by rounding. Bugfix candidate, but I already backported this to 2.2. In 2.3, this code remains in severe need of refactoring.
* Renamed PyObject_GenericGetIter to PyObject_SelfIterRaymond Hettinger2003-03-174-15/+15
| | | | | | to more accurately describe what the function does. Suggested by Thomas Wouters.
* Added a define EXTRAMACHDEPPATH which can be used to add sys.path itemsJack Jansen2003-03-171-1/+2
| | | | | | | | for specific platforms. Use this to add plat-mac and plat-mac/lib-scriptpackages on MacOSX. Also tested for not having adverse effects on Linux, and I think this code isn't used on Windows anyway. Fixes #661521.
* binascii_a2b_base64: Properly return an empty string if the input was allThomas Wouters2003-03-171-1/+8
| | | | | | | invalid, rather than returning a string of random garbage of the estimated result length. Closes SF patch #703471 by Hye-Shik Chang. Will backport to 2.2-maint (consider it done.)
* Created PyObject_GenericGetIter().Raymond Hettinger2003-03-173-24/+3
| | | | Factors out the common case of returning self.
* Created PyObject_GenericGetIter().Raymond Hettinger2003-03-171-96/+12
| | | | Factors out the common case of returning self.
* - New function time.tzset() provides access to the C library tzet()Guido van Rossum2003-03-141-74/+144
| | | | function, if supported. (SF patch #675422, by Stuart Bishop.)
* Take out my (long since disabled) POSIX signal mask handling code.Michael W. Hudson2003-03-131-171/+0
| | | | | I'm not going to have the time or energy to get this working x-platform -- anyone who does is welcome to the code!
* Open with O_NONBLOCK to avoid hanging on open().Greg Ward2003-03-111-1/+5
|
* <sys/soundcard.h> seems to exist on both Linux and FreeBSD, so includeGreg Ward2003-03-101-22/+10
| | | | | | | | | it instead of the OS-specific <linux/soundcard.h> or <machine/soundcard.h>. Mixers devices have an ioctl-only interface, no read/write -- so the flags passed to open() don't really matter. Thus, drop the 'mode' parameter to openmixer() (ie. second arg to newossmixerobject()) and always open mixers with O_RDWR.
* An #endif was missing in Just's patch. Added.Jack Jansen2003-03-051-0/+1
|
* removing one Mac hack and add another:Just van Rossum2003-03-051-26/+16
| | | | | | | - The applet logic has been replaced to bundlebuilder's bootstrap script - Due to Apple being extremely string about argv[0], we need a way to specify the actual executable name for use with sys.executable. See the comment embedded in the code.
* Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,Martin v. Löwis2003-03-051-20/+0
| | | | | and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding. Adjust test case.
* Patch #696645: Remove VMS code with uncertain authorship.Martin v. Löwis2003-03-053-301/+60
|
* os.listdir(): Fall back to the original byte string if conversion to unicodeJust van Rossum2003-03-041-6/+8
| | | | fails, as discussed in patch #683592.
* Fix SF #692416, don't crash interpreter for _tkinter.deletefilehandlerNeal Norwitz2003-03-031-1/+13
| | | | in addition to createfilehandler and creaetetimerhandler.
* plugged leak noted by nnorwitz: the 'et' format returns allocated memoryJust van Rossum2003-03-031-2/+4
|
* Patch #683592 revisited, after discussions with MvL:Just van Rossum2003-03-031-10/+8
| | | | | | | | | | | | | | | | | | - Implement the behavior as specified in PEP 277, meaning os.listdir() will only return unicode strings if it is _called_ with a unicode argument. - And then return only unicode, don't attempt to convert to ASCII. - Don't switch on Py_FileSystemDefaultEncoding, but simply use the default encoding if Py_FileSystemDefaultEncoding is NULL. This means os.listdir() can now raise UnicodeDecodeError if the default encoding can't represent the directory entry. (This seems better than silcencing the error and fall back to a byte string.) - Attempted to decribe the above in Doc/lib/libos.tex. - Reworded the Misc/NEWS items to reflect the current situation. This checkin also fixes bug #696261, which was due to os.listdir() not using Py_FileSystemDefaultEncoding, like all file system calls are supposed to.
* Fix bugMichael W. Hudson2003-03-031-11/+83
| | | | | | | | [ 555817 ] Flawed fcntl.ioctl implementation. with my patch that allows for an array to be mutated when passed as the buffer argument to ioctl() (details complicated by backwards compatibility considerations -- read the docs!).
* Don't crash on _tkinter.createfilehandler in non-threaded Tcl;Martin v. Löwis2003-03-031-1/+26
| | | | | disable this function in threaded Tcl. Likewise for creaetetimerhandler. Fixes #692416.
* get_completer() takes no argsNeal Norwitz2003-03-011-1/+1
|
* Several of the tools can make direct calls the inner iterators.Raymond Hettinger2003-03-011-9/+24
|
* Fix SF bug #690012 (among others), iconv_codec stops buildNeal Norwitz2003-02-281-3/+3
| | | | | | | | Change setup.py to catch all exceptions. - Rename module if the exception was an ImportError - Only warn if the exception was any other error Revert _iconv_codec to raising a RuntimeError.
* use proper constant instead of comment (noted by nnorwitz)Just van Rossum2003-02-281-1/+1
|
* Fix SF bug #694816, remove comparison of unsigned value < 0Neal Norwitz2003-02-281-2/+2
|
* Patch #683592: unicode support for os.listdir()Just van Rossum2003-02-251-0/+24
| | | | | os.listdir() may now return unicode strings on platforms that set Py_FileSystemDefaultEncoding.
* Change the test encoding from "ISO8859-1" to "ISO-8859-1"Walter Dörwald2003-02-241-4/+4
| | | | | | | | | (see SF bug #690309) and raise ImportErrors instead of RuntimeErrors, so building Python continues even if importing iconv_codecs fails. This is a temporary fix until we get proper configure support for "broken" iconv implementations.
* SF patch #687598, array.append is sloooowNeal Norwitz2003-02-241-2/+47
| | | | This improves speed by about 5.6% for me.
* User requested changes to the itertools module.Raymond Hettinger2003-02-231-52/+236
| | | | | Subsumed times() into repeat(). Added cycle() and chain().
* Use 'ISO8859-1' instead of 'ASCII' when testing whether byteswappingWalter Dörwald2003-02-211-5/+5
| | | | | | | | | | is required for the chosen internal encoding in the init function, as this seems to have a better chance of working under Irix and Solaris. Also change the test character from '\x01' to '0'. This might fix SF bug #690309.
* flex_complete looks like a private (but callback) function, so make it staticNeal Norwitz2003-02-211-1/+1
|
* The connect timeout code wasn't working on Windows.Guido van Rossum2003-02-191-12/+13
| | | | | | Rather than trying to second-guess the various error returns of a second connect(), use select() to determine whether the socket becomes writable (which means connected).
* - PyEval_GetFrame() is now declared to return a PyFrameObject *Guido van Rossum2003-02-191-1/+1
| | | | instead of a plain PyObject *. (SF patch #686601 by Ben Laurie.)
* os.mkdir() would crash with a Unicode filename and mode param.Mark Hammond2003-02-191-1/+1
|
* Use __reduce_ex__.Guido van Rossum2003-02-191-45/+36
|
* save_global(): Trying to resolve module.name can fail for twoTim Peters2003-02-181-3/+5
| | | | | | | reasons: importing module can fail, or the attribute lookup module.name can fail. We were giving the same error msg for both cases, making it needlessly hard to guess what went wrong. These cases give different error msgs now.
* Fold some long lines.Guido van Rossum2003-02-181-14/+31
| | | | Change fatal errors during module initialization into RuntimeErrors.
* Fix 64-bit problem, ParseTuple("i") needs C ints; ("l") needs C longs.Neal Norwitz2003-02-181-1/+1
| | | | | Use "l" as that *probably* makes more sense (at least to me it does :-) And the test passes on the alpha.
* Added test_posix (hopefully it works on Windows).Neal Norwitz2003-02-171-130/+64
| | | | | Remove PyArg_ParseTuple() for methods which take no args, use METH_NOARGS instead
* Use correct function name to PyArg_ParseTuple("is_package").Neal Norwitz2003-02-171-5/+2
| | | | | | | | | | | | Fix off-by-1 error in normalize_line_endings(): when *p == '\0' the NUL was copied into q and q was auto-incremented, the loop was broken out of, then a newline was appended followed by a NUL. So the function, in effect, was strcpy() but added two extra chars which was caught by obmalloc in debug mode, since there was only room for 1 additional newline. Get test working under regrtest (added test_main).
* Make 2 module variables static. Assuming this is correct.Neal Norwitz2003-02-151-2/+2
|
* cPickle.c, load_build(): Taught cPickle how to pick apartTim Peters2003-02-151-21/+71
| | | | | | | | | | | | | | | | | | the optional proto 2 slot state. pickle.py, load_build(): CAUTION: Noted that cPickle's load_build and pickle's load_build really don't do the same things with the state, and didn't before this patch either. cPickle never tries to do .update(), and has no backoff if instance.__dict__ can't be retrieved. There are no tests that can tell the difference, and part of what cPickle's load_build() did looked accidental to me, so I don't know what the true intent is here. pickletester.py, test_pickle.py: Got rid of the hack for exempting cPickle from running some of the proto 2 tests. dictobject.c, PyDict_Next(): documented intended use.
* cPickle produces NEWOBJ appropriately now. It still doesn't knowTim Peters2003-02-141-69/+195
| | | | how to unpickle the new slot-full state tuples.
* Minor assorted cleanups; no semantic changes.Tim Peters2003-02-131-10/+16
|
* The version of PyImport_Import() in cPickle is no longer needed (an editedTim Peters2003-02-131-64/+0
| | | | version was moved into import.c long ago), so squashed the duplication.
* save(): Reformat tail end just for clarity.Tim Peters2003-02-131-16/+17
|