summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-10-11 00:49:57 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-10-11 00:49:57 (GMT)
commitf10a79aad4e2fc62d2c3675e89f873b22b185e7b (patch)
tree06b042ca03a71663d26ad95949807d1bd2472bf4 /Modules
parent2d8dcdcb06005858e87eded012ceff10920445b7 (diff)
downloadcpython-f10a79aad4e2fc62d2c3675e89f873b22b185e7b.zip
cpython-f10a79aad4e2fc62d2c3675e89f873b22b185e7b.tar.gz
cpython-f10a79aad4e2fc62d2c3675e89f873b22b185e7b.tar.bz2
merge from trunk
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bisectmodule.c4
-rw-r--r--Modules/_codecsmodule.c2
-rw-r--r--Modules/cjkcodecs/multibytecodec.c2
-rw-r--r--Modules/posixmodule.c7
4 files changed, 10 insertions, 5 deletions
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index b84509b..fe2e110 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -82,7 +82,7 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
index = internal_bisect_right(list, item, lo, hi);
if (index < 0)
return NULL;
- if (PyList_Check(list)) {
+ if (PyList_CheckExact(list)) {
if (PyList_Insert(list, index, item) < 0)
return NULL;
} else {
@@ -183,7 +183,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
index = internal_bisect_left(list, item, lo, hi);
if (index < 0)
return NULL;
- if (PyList_Check(list)) {
+ if (PyList_CheckExact(list)) {
if (PyList_Insert(list, index, item) < 0)
return NULL;
} else {
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index 5026c05..fc3e3f9 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -108,7 +108,7 @@ Decodes obj using the codec registered for encoding. encoding defaults\n\
to the default encoding. errors may be given to set a different error\n\
handling scheme. Default is 'strict' meaning that encoding errors raise\n\
a ValueError. Other possible values are 'ignore' and 'replace'\n\
-as well as any other name registerd with codecs.register_error that is\n\
+as well as any other name registered with codecs.register_error that is\n\
able to handle ValueErrors.");
static PyObject *
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 67c25b1..2732270 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -36,7 +36,7 @@ PyDoc_STRVAR(MultibyteCodec_Decode__doc__,
Decodes `string' using I, an MultibyteCodec instance. errors may be given\n\
to set a different error handling scheme. Default is 'strict' meaning\n\
that encoding errors raise a UnicodeDecodeError. Other possible values\n\
-are 'ignore' and 'replace' as well as any other name registerd with\n\
+are 'ignore' and 'replace' as well as any other name registered with\n\
codecs.register_error that is able to handle UnicodeDecodeErrors.");
static char *codeckwarglist[] = {"input", "errors", NULL};
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 12ee9a8..c725b7d 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -751,11 +751,16 @@ win32_wchdir(LPCWSTR path)
if (!result)
return FALSE;
if (result > MAX_PATH+1) {
- new_path = malloc(result);
+ new_path = malloc(result * sizeof(wchar_t));
if (!new_path) {
SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
+ result = GetCurrentDirectoryW(result, new_path);
+ if (!result) {
+ free(new_path);
+ return FALSE;
+ }
}
if (wcsncmp(new_path, L"\\\\", 2) == 0 ||
wcsncmp(new_path, L"//", 2) == 0)