| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
| |
refactoring to get all the duplicates of this delicate code out of the
cPickle and struct modules.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
to more accurately describe what the function does.
Suggested by Thomas Wouters.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
| |
Factors out the common case of returning self.
|
|
|
|
| |
Factors out the common case of returning self.
|
|
|
|
| |
function, if supported. (SF patch #675422, by Stuart Bishop.)
|
|
|
|
|
| |
I'm not going to have the time or energy to get this working x-platform
-- anyone who does is welcome to the code!
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding.
Adjust test case.
|
| |
|
|
|
|
| |
fails, as discussed in patch #683592.
|
|
|
|
| |
in addition to createfilehandler and creaetetimerhandler.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
| |
[ 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!).
|
|
|
|
|
| |
disable this function in threaded Tcl. Likewise for creaetetimerhandler.
Fixes #692416.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
os.listdir() may now return unicode strings on platforms that set
Py_FileSystemDefaultEncoding.
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
| |
This improves speed by about 5.6% for me.
|
|
|
|
|
| |
Subsumed times() into repeat().
Added cycle() and chain().
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
instead of a plain PyObject *. (SF patch #686601 by Ben Laurie.)
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Change fatal errors during module initialization into RuntimeErrors.
|
|
|
|
|
| |
Use "l" as that *probably* makes more sense (at least to me it does :-)
And the test passes on the alpha.
|
|
|
|
|
| |
Remove PyArg_ParseTuple() for methods which take no args,
use METH_NOARGS instead
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
how to unpickle the new slot-full state tuples.
|
| |
|
|
|
|
| |
version was moved into import.c long ago), so squashed the duplication.
|
| |
|