summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-03-03 13:19:44 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-03-03 13:19:44 (GMT)
commit885d4f65776b650e51301ac4cb3138fa08c82cda (patch)
tree31e80aac1171eee06a8d9faabde30f7764a6c234
parentd505cab5b3c9074aa678a33f03f97623d3e5fd28 (diff)
downloadcpython-885d4f65776b650e51301ac4cb3138fa08c82cda.zip
cpython-885d4f65776b650e51301ac4cb3138fa08c82cda.tar.gz
cpython-885d4f65776b650e51301ac4cb3138fa08c82cda.tar.bz2
Mod to previous checkin: we must require ascii, not system defautl encoding,
because we have no easy way to convert the python encoding string to a CF encoding parameter.
-rw-r--r--Mac/Modules/cf/cfsupport.py2
-rw-r--r--Mac/Modules/cf/pycfbridge.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py
index bb0ac40..e8fb710 100644
--- a/Mac/Modules/cf/cfsupport.py
+++ b/Mac/Modules/cf/cfsupport.py
@@ -360,7 +360,7 @@ class CFStringRefObjectDefinition(MyGlobalObjectDefinition):
if (v == Py_None) { *p_itself = NULL; return 1; }
if (PyString_Check(v)) {
char *cStr;
- if (!PyArg_Parse(v, "et", "ascii", &cStr))
+ if (!PyArg_Parse(v, "es", "ascii", &cStr))
return NULL;
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
return 1;
diff --git a/Mac/Modules/cf/pycfbridge.c b/Mac/Modules/cf/pycfbridge.c
index d4466ac..21a9522 100644
--- a/Mac/Modules/cf/pycfbridge.c
+++ b/Mac/Modules/cf/pycfbridge.c
@@ -292,7 +292,7 @@ PyCF_Python2CF_string(PyObject *src, CFStringRef *dst) {
UniChar *unichars;
if (PyString_Check(src)) {
- if (!PyArg_Parse(src, "es", NULL, &chars))
+ if (!PyArg_Parse(src, "es", "ascii", &chars))
return NULL; /* This error is more descriptive than the general one below */
*dst = CFStringCreateWithCString((CFAllocatorRef)NULL, chars, kCFStringEncodingASCII);
return 1;