summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hammond <mhammond@skippinet.com.au>2001-05-14 12:17:34 (GMT)
committerMark Hammond <mhammond@skippinet.com.au>2001-05-14 12:17:34 (GMT)
commit26cffde4c2950ac2afb41f19a65a28c4e905060d (patch)
tree04a94c73efbc91aa0a7492ccb8ce1d744f5b3fd9
parent834f4dd7c921593674409b9088458f378ac00ca4 (diff)
downloadcpython-26cffde4c2950ac2afb41f19a65a28c4e905060d.zip
cpython-26cffde4c2950ac2afb41f19a65a28c4e905060d.tar.gz
cpython-26cffde4c2950ac2afb41f19a65a28c4e905060d.tar.bz2
Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a fileobject.h, and initialize it in bltinmodule.
-rw-r--r--Include/fileobject.h5
-rw-r--r--Modules/posixmodule.c10
-rw-r--r--Python/bltinmodule.c9
3 files changed, 13 insertions, 11 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h
index aefeffe..a3670c2 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -23,6 +23,11 @@ extern DL_IMPORT(int) PyFile_SoftSpace(PyObject *, int);
extern DL_IMPORT(int) PyFile_WriteString(char *, PyObject *);
extern DL_IMPORT(int) PyObject_AsFileDescriptor(PyObject *);
+/* The default encoding used by the platform file system APIs
+ If non-NULL, this is different than the default encoding for strings
+*/
+extern DL_IMPORT(const char *) Py_FileSystemDefaultEncoding;
+
#ifdef __cplusplus
}
#endif
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 87d584e..430a44a 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -233,16 +233,6 @@ extern int lstat(const char *, struct stat *);
#endif /* MS_WIN32 */
#endif /* _MSC_VER */
-/* The default encoding used by the platform file system APIs
- If non-NULL, this is almost certainly different than the default
- encoding for strings (otherwise it can remain NULL!)
-*/
-#ifdef MS_WIN32
-const char *Py_FileSystemDefaultEncoding = "mbcs";
-#else
-const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
-#endif
-
#if defined(PYCC_VACPP) && defined(PYOS_OS2)
#include <io.h>
#endif /* OS2 */
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 5ffecb3..b647f3b 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -13,7 +13,14 @@
#include <unistd.h>
#endif
-extern const char *Py_FileSystemDefaultEncoding;
+/* The default encoding used by the platform file system APIs
+ Can remain NULL for all platforms that don't have such a concept
+*/
+#ifdef MS_WIN32
+const char *Py_FileSystemDefaultEncoding = "mbcs";
+#else
+const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
+#endif
/* Forward */
static PyObject *filterstring(PyObject *, PyObject *);