Merged revisions 72698-72699 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72698 | hirokazu.yamamoto | 2009-05-17 11:52:09 +0900 | 1 line

  Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
........
  r72699 | hirokazu.yamamoto | 2009-05-17 11:58:36 +0900 | 1 line

  Added NEWS for r72698.
........
This commit is contained in:
Hirokazu Yamamoto 2009-05-17 04:21:53 +00:00
parent 266c9905df
commit 8223c24d07
6 changed files with 23 additions and 41 deletions

View File

@ -177,10 +177,10 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *); PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, const Py_UNICODE *); PyObject *, const Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...); PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
@ -189,19 +189,15 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
int, const char *); int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
int, const char *); int, const char *);
#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *); int, const Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
PyObject *,int, PyObject *); PyObject *,int, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
PyObject *,int, const char *); PyObject *,int, const char *);
#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *); PyObject *,int, const Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */

View File

@ -12,6 +12,8 @@ What's New in Python 3.1 release candidate 1?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
- Issue #5994: the marshal module now has docstrings. - Issue #5994: the marshal module now has docstrings.
- Issue #5981: Fix three minor inf/nan issues in float.fromhex: - Issue #5981: Fix three minor inf/nan issues in float.fromhex:

View File

@ -223,7 +223,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
PyErr_Clear(); PyErr_Clear();
} }
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
if (GetVersion() < 0x80000000) { if (GetVersion() < 0x80000000) {
/* On NT, so wide API available */ /* On NT, so wide API available */
if (PyUnicode_Check(nameobj)) if (PyUnicode_Check(nameobj))

View File

@ -581,13 +581,13 @@ posix_error_with_filename(char* name)
return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name); return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
} }
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
static PyObject * static PyObject *
posix_error_with_unicode_filename(Py_UNICODE* name) posix_error_with_unicode_filename(Py_UNICODE* name)
{ {
return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name); return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name);
} }
#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */
static PyObject * static PyObject *
@ -615,7 +615,6 @@ win32_error(char* function, char* filename)
return PyErr_SetFromWindowsErr(errno); return PyErr_SetFromWindowsErr(errno);
} }
#ifdef Py_WIN_WIDE_FILENAMES
static PyObject * static PyObject *
win32_error_unicode(char* function, Py_UNICODE* filename) win32_error_unicode(char* function, Py_UNICODE* filename)
{ {
@ -644,9 +643,7 @@ convert_to_unicode(PyObject **param)
return (*param) != NULL; return (*param) != NULL;
} }
#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */
#endif
#if defined(PYOS_OS2) #if defined(PYOS_OS2)
/********************************************************************** /**********************************************************************
@ -745,7 +742,7 @@ posix_fildes(PyObject *fdobj, int (*func)(int))
return Py_None; return Py_None;
} }
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
static int static int
unicode_file_names(void) unicode_file_names(void)
{ {
@ -808,7 +805,7 @@ posix_2str(PyObject *args,
return Py_None; return Py_None;
} }
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
static PyObject* static PyObject*
win32_1str(PyObject* args, char* func, win32_1str(PyObject* args, char* func,
char* format, BOOL (__stdcall *funcA)(LPCSTR), char* format, BOOL (__stdcall *funcA)(LPCSTR),
@ -1564,7 +1561,6 @@ IsUNCRootA(char *path, int pathlen)
#undef ISSLASH #undef ISSLASH
} }
#ifdef Py_WIN_WIDE_FILENAMES
static BOOL static BOOL
IsUNCRootW(Py_UNICODE *path, int pathlen) IsUNCRootW(Py_UNICODE *path, int pathlen)
{ {
@ -1587,7 +1583,6 @@ IsUNCRootW(Py_UNICODE *path, int pathlen)
#undef ISSLASH #undef ISSLASH
} }
#endif /* Py_WIN_WIDE_FILENAMES */
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */
static PyObject * static PyObject *
@ -1607,7 +1602,7 @@ posix_do_stat(PyObject *self, PyObject *args,
int res; int res;
PyObject *result; PyObject *result;
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
/* If on wide-character-capable OS see if argument /* If on wide-character-capable OS see if argument
is Unicode and if so use wide API. */ is Unicode and if so use wide API. */
if (unicode_file_names()) { if (unicode_file_names()) {
@ -1670,7 +1665,7 @@ posix_access(PyObject *self, PyObject *args)
char *path; char *path;
int mode; int mode;
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
DWORD attr; DWORD attr;
if (unicode_file_names()) { if (unicode_file_names()) {
PyUnicodeObject *po; PyUnicodeObject *po;
@ -1827,7 +1822,7 @@ posix_chmod(PyObject *self, PyObject *args)
char *path = NULL; char *path = NULL;
int i; int i;
int res; int res;
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
DWORD attr; DWORD attr;
if (unicode_file_names()) { if (unicode_file_names()) {
PyUnicodeObject *po; PyUnicodeObject *po;
@ -1878,7 +1873,7 @@ posix_chmod(PyObject *self, PyObject *args)
release_bytes(opath); release_bytes(opath);
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
#else /* Py_WIN_WIDE_FILENAMES */ #else /* MS_WINDOWS */
if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter, if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter,
&opath, &i)) &opath, &i))
return NULL; return NULL;
@ -2128,7 +2123,7 @@ posix_getcwd(int use_bytes)
char buf[1026]; char buf[1026];
char *res; char *res;
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
if (!use_bytes && unicode_file_names()) { if (!use_bytes && unicode_file_names()) {
wchar_t wbuf[1026]; wchar_t wbuf[1026];
wchar_t *wbuf2 = wbuf; wchar_t *wbuf2 = wbuf;
@ -2233,7 +2228,6 @@ posix_listdir(PyObject *self, PyObject *args)
char *bufptr = namebuf; char *bufptr = namebuf;
Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */ Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */
#ifdef Py_WIN_WIDE_FILENAMES
/* If on wide-character-capable OS see if argument /* If on wide-character-capable OS see if argument
is Unicode and if so use wide API. */ is Unicode and if so use wide API. */
if (unicode_file_names()) { if (unicode_file_names()) {
@ -2316,7 +2310,6 @@ posix_listdir(PyObject *self, PyObject *args)
are also valid. */ are also valid. */
PyErr_Clear(); PyErr_Clear();
} }
#endif
if (!PyArg_ParseTuple(args, "O&:listdir", if (!PyArg_ParseTuple(args, "O&:listdir",
PyUnicode_FSConverter, &opath)) PyUnicode_FSConverter, &opath))
@ -2553,7 +2546,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
char *path; char *path;
char outbuf[MAX_PATH*2]; char outbuf[MAX_PATH*2];
char *temp; char *temp;
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
if (unicode_file_names()) { if (unicode_file_names()) {
PyUnicodeObject *po; PyUnicodeObject *po;
if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) { if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
@ -2615,7 +2608,7 @@ posix_mkdir(PyObject *self, PyObject *args)
char *path; char *path;
int mode = 0777; int mode = 0777;
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
if (unicode_file_names()) { if (unicode_file_names()) {
PyUnicodeObject *po; PyUnicodeObject *po;
if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) { if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) {
@ -2921,7 +2914,7 @@ second form is used, set the access and modified times to the current time.");
static PyObject * static PyObject *
posix_utime(PyObject *self, PyObject *args) posix_utime(PyObject *self, PyObject *args)
{ {
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
PyObject *arg; PyObject *arg;
PyUnicodeObject *obwpath; PyUnicodeObject *obwpath;
wchar_t *wpath = NULL; wchar_t *wpath = NULL;
@ -3001,7 +2994,7 @@ posix_utime(PyObject *self, PyObject *args)
done: done:
CloseHandle(hFile); CloseHandle(hFile);
return result; return result;
#else /* Py_WIN_WIDE_FILENAMES */ #else /* MS_WINDOWS */
PyObject *opath; PyObject *opath;
char *path; char *path;
@ -3077,7 +3070,7 @@ done:
#undef UTIME_ARG #undef UTIME_ARG
#undef ATIME #undef ATIME
#undef MTIME #undef MTIME
#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */
} }
@ -6803,7 +6796,7 @@ win32_startfile(PyObject *self, PyObject *args)
char *filepath; char *filepath;
char *operation = NULL; char *operation = NULL;
HINSTANCE rc; HINSTANCE rc;
#ifdef Py_WIN_WIDE_FILENAMES
if (unicode_file_names()) { if (unicode_file_names()) {
PyObject *unipath, *woperation = NULL; PyObject *unipath, *woperation = NULL;
if (!PyArg_ParseTuple(args, "U|s:startfile", if (!PyArg_ParseTuple(args, "U|s:startfile",
@ -6838,7 +6831,6 @@ win32_startfile(PyObject *self, PyObject *args)
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
#endif
normal: normal:
if (!PyArg_ParseTuple(args, "O&|s:startfile", if (!PyArg_ParseTuple(args, "O&|s:startfile",

View File

@ -558,10 +558,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* This is enough for unicodeobject.h to do the "right thing" on Windows. */ /* This is enough for unicodeobject.h to do the "right thing" on Windows. */
#define Py_UNICODE_SIZE 2 #define Py_UNICODE_SIZE 2
/* Define to indicate that the Python Unicode representation can be passed
as-is to Win32 Wide API. */
#define Py_WIN_WIDE_FILENAMES
/* Use Python's own small-block memory-allocator. */ /* Use Python's own small-block memory-allocator. */
#define WITH_PYMALLOC 1 #define WITH_PYMALLOC 1

View File

@ -461,7 +461,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
return result; return result;
} }
#ifdef Py_WIN_WIDE_FILENAMES #ifdef MS_WINDOWS
PyObject * PyObject *
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename) PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
{ {
@ -472,7 +472,7 @@ PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
Py_XDECREF(name); Py_XDECREF(name);
return result; return result;
} }
#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */
PyObject * PyObject *
PyErr_SetFromErrno(PyObject *exc) PyErr_SetFromErrno(PyObject *exc)
@ -549,7 +549,6 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
return ret; return ret;
} }
#ifdef Py_WIN_WIDE_FILENAMES
PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *exc, PyObject *exc,
int ierr, int ierr,
@ -564,7 +563,6 @@ PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
Py_XDECREF(name); Py_XDECREF(name);
return ret; return ret;
} }
#endif /* Py_WIN_WIDE_FILENAMES */
PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr) PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
{ {
@ -588,7 +586,6 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
return result; return result;
} }
#ifdef Py_WIN_WIDE_FILENAMES
PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
int ierr, int ierr,
const Py_UNICODE *filename) const Py_UNICODE *filename)
@ -602,7 +599,6 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
Py_XDECREF(name); Py_XDECREF(name);
return result; return result;
} }
#endif /* Py_WIN_WIDE_FILENAMES */
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */
void void