summaryrefslogtreecommitdiffstats
path: root/Python/dynload_stub.c
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-05-09 04:14:36 (GMT)
committerCollin Winter <collinw@gmail.com>2007-05-09 04:14:36 (GMT)
commitfa9be8c289a963bbd626c452b7c0a2ddde12a7ef (patch)
treee2d4819cbe6d3e41d7e5b126caecd6b1d475bd25 /Python/dynload_stub.c
parentabe1d48d2068ef0fea36a9b370a8b159ab267430 (diff)
downloadcpython-fa9be8c289a963bbd626c452b7c0a2ddde12a7ef.zip
cpython-fa9be8c289a963bbd626c452b7c0a2ddde12a7ef.tar.gz
cpython-fa9be8c289a963bbd626c452b7c0a2ddde12a7ef.tar.bz2
Fix a bug in test.test_support.open_urlresource().
If the call to requires() doesn't precede the filesystem check, we get the following situation: 1. ./python Lib/test/regrtest.py test_foo # test needs urlfetch, not enabled, so skipped 2. ./python Lib/test/regrtest.py -u urlfetch test_foo # test runs 3. ./python Lib/test/regrtest.py test_foo # test runs (!) By moving the call to requires() *before* the filesystem check, the fact that fetched files are cached on the local disk becomes an implementation detail, rather than a semantics-changing point of note.
Diffstat (limited to 'Python/dynload_stub.c')
0 files changed, 0 insertions, 0 deletions
odules/cPickle.c @@ -418,31 +418,6 @@ cPickle_ErrFormat(PyObject *ErrType, char *stringformat, char *format, ...) } static int -write_file(Picklerobject *self, const char *s, Py_ssize_t n) -{ - size_t nbyteswritten; - - if (s == NULL) { - return 0; - } - - if (n > INT_MAX) { - /* String too large */ - return -1; - } - - Py_BEGIN_ALLOW_THREADS - nbyteswritten = fwrite(s, sizeof(char), n, self->fp); - Py_END_ALLOW_THREADS - if (nbyteswritten != (size_t)n) { - PyErr_SetFromErrno(PyExc_IOError); - return -1; - } - - return (int)n; -} - -static int write_cStringIO(Picklerobject *self, const char *s, Py_ssize_t n) { if (s == NULL) { @@ -517,92 +492,6 @@ write_other(Picklero