mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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:
parent
266c9905df
commit
8223c24d07
6 changed files with 23 additions and 41 deletions
|
|
@ -581,13 +581,13 @@ posix_error_with_filename(char* name)
|
|||
return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
|
||||
}
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
static PyObject *
|
||||
posix_error_with_unicode_filename(Py_UNICODE* name)
|
||||
{
|
||||
return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name);
|
||||
}
|
||||
#endif /* Py_WIN_WIDE_FILENAMES */
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
|
||||
static PyObject *
|
||||
|
|
@ -615,7 +615,6 @@ win32_error(char* function, char* filename)
|
|||
return PyErr_SetFromWindowsErr(errno);
|
||||
}
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
static PyObject *
|
||||
win32_error_unicode(char* function, Py_UNICODE* filename)
|
||||
{
|
||||
|
|
@ -644,9 +643,7 @@ convert_to_unicode(PyObject **param)
|
|||
return (*param) != NULL;
|
||||
}
|
||||
|
||||
#endif /* Py_WIN_WIDE_FILENAMES */
|
||||
|
||||
#endif
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
#if defined(PYOS_OS2)
|
||||
/**********************************************************************
|
||||
|
|
@ -745,7 +742,7 @@ posix_fildes(PyObject *fdobj, int (*func)(int))
|
|||
return Py_None;
|
||||
}
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
static int
|
||||
unicode_file_names(void)
|
||||
{
|
||||
|
|
@ -808,7 +805,7 @@ posix_2str(PyObject *args,
|
|||
return Py_None;
|
||||
}
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
static PyObject*
|
||||
win32_1str(PyObject* args, char* func,
|
||||
char* format, BOOL (__stdcall *funcA)(LPCSTR),
|
||||
|
|
@ -1564,7 +1561,6 @@ IsUNCRootA(char *path, int pathlen)
|
|||
#undef ISSLASH
|
||||
}
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
static BOOL
|
||||
IsUNCRootW(Py_UNICODE *path, int pathlen)
|
||||
{
|
||||
|
|
@ -1587,7 +1583,6 @@ IsUNCRootW(Py_UNICODE *path, int pathlen)
|
|||
|
||||
#undef ISSLASH
|
||||
}
|
||||
#endif /* Py_WIN_WIDE_FILENAMES */
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
static PyObject *
|
||||
|
|
@ -1607,7 +1602,7 @@ posix_do_stat(PyObject *self, PyObject *args,
|
|||
int res;
|
||||
PyObject *result;
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
/* If on wide-character-capable OS see if argument
|
||||
is Unicode and if so use wide API. */
|
||||
if (unicode_file_names()) {
|
||||
|
|
@ -1670,7 +1665,7 @@ posix_access(PyObject *self, PyObject *args)
|
|||
char *path;
|
||||
int mode;
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
DWORD attr;
|
||||
if (unicode_file_names()) {
|
||||
PyUnicodeObject *po;
|
||||
|
|
@ -1827,7 +1822,7 @@ posix_chmod(PyObject *self, PyObject *args)
|
|||
char *path = NULL;
|
||||
int i;
|
||||
int res;
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
DWORD attr;
|
||||
if (unicode_file_names()) {
|
||||
PyUnicodeObject *po;
|
||||
|
|
@ -1878,7 +1873,7 @@ posix_chmod(PyObject *self, PyObject *args)
|
|||
release_bytes(opath);
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
#else /* Py_WIN_WIDE_FILENAMES */
|
||||
#else /* MS_WINDOWS */
|
||||
if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter,
|
||||
&opath, &i))
|
||||
return NULL;
|
||||
|
|
@ -2128,7 +2123,7 @@ posix_getcwd(int use_bytes)
|
|||
char buf[1026];
|
||||
char *res;
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
if (!use_bytes && unicode_file_names()) {
|
||||
wchar_t wbuf[1026];
|
||||
wchar_t *wbuf2 = wbuf;
|
||||
|
|
@ -2233,7 +2228,6 @@ posix_listdir(PyObject *self, PyObject *args)
|
|||
char *bufptr = namebuf;
|
||||
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
|
||||
is Unicode and if so use wide API. */
|
||||
if (unicode_file_names()) {
|
||||
|
|
@ -2316,7 +2310,6 @@ posix_listdir(PyObject *self, PyObject *args)
|
|||
are also valid. */
|
||||
PyErr_Clear();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O&:listdir",
|
||||
PyUnicode_FSConverter, &opath))
|
||||
|
|
@ -2553,7 +2546,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
|
|||
char *path;
|
||||
char outbuf[MAX_PATH*2];
|
||||
char *temp;
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
if (unicode_file_names()) {
|
||||
PyUnicodeObject *po;
|
||||
if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
|
||||
|
|
@ -2615,7 +2608,7 @@ posix_mkdir(PyObject *self, PyObject *args)
|
|||
char *path;
|
||||
int mode = 0777;
|
||||
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
if (unicode_file_names()) {
|
||||
PyUnicodeObject *po;
|
||||
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 *
|
||||
posix_utime(PyObject *self, PyObject *args)
|
||||
{
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
#ifdef MS_WINDOWS
|
||||
PyObject *arg;
|
||||
PyUnicodeObject *obwpath;
|
||||
wchar_t *wpath = NULL;
|
||||
|
|
@ -3001,7 +2994,7 @@ posix_utime(PyObject *self, PyObject *args)
|
|||
done:
|
||||
CloseHandle(hFile);
|
||||
return result;
|
||||
#else /* Py_WIN_WIDE_FILENAMES */
|
||||
#else /* MS_WINDOWS */
|
||||
|
||||
PyObject *opath;
|
||||
char *path;
|
||||
|
|
@ -3077,7 +3070,7 @@ done:
|
|||
#undef UTIME_ARG
|
||||
#undef ATIME
|
||||
#undef MTIME
|
||||
#endif /* Py_WIN_WIDE_FILENAMES */
|
||||
#endif /* MS_WINDOWS */
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -6803,7 +6796,7 @@ win32_startfile(PyObject *self, PyObject *args)
|
|||
char *filepath;
|
||||
char *operation = NULL;
|
||||
HINSTANCE rc;
|
||||
#ifdef Py_WIN_WIDE_FILENAMES
|
||||
|
||||
if (unicode_file_names()) {
|
||||
PyObject *unipath, *woperation = NULL;
|
||||
if (!PyArg_ParseTuple(args, "U|s:startfile",
|
||||
|
|
@ -6838,7 +6831,6 @@ win32_startfile(PyObject *self, PyObject *args)
|
|||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
#endif
|
||||
|
||||
normal:
|
||||
if (!PyArg_ParseTuple(args, "O&|s:startfile",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue