Skip to content

Commit 8223c24

Browse files
author
Hirokazu Yamamoto
committed
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. ........
1 parent 266c990 commit 8223c24

6 files changed

Lines changed: 23 additions & 41 deletions

File tree

Include/pyerrors.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
177177
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
178178
PyObject *, PyObject *);
179179
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
180-
#ifdef Py_WIN_WIDE_FILENAMES
180+
#ifdef MS_WINDOWS
181181
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
182182
PyObject *, const Py_UNICODE *);
183-
#endif /* Py_WIN_WIDE_FILENAMES */
183+
#endif /* MS_WINDOWS */
184184

185185
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
186186

@@ -189,19 +189,15 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
189189
int, const char *);
190190
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
191191
int, const char *);
192-
#ifdef Py_WIN_WIDE_FILENAMES
193192
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
194193
int, const Py_UNICODE *);
195-
#endif /* Py_WIN_WIDE_FILENAMES */
196194
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
197195
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
198196
PyObject *,int, PyObject *);
199197
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
200198
PyObject *,int, const char *);
201-
#ifdef Py_WIN_WIDE_FILENAMES
202199
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
203200
PyObject *,int, const Py_UNICODE *);
204-
#endif /* Py_WIN_WIDE_FILENAMES */
205201
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
206202
#endif /* MS_WINDOWS */
207203

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 3.1 release candidate 1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.
16+
1517
- Issue #5994: the marshal module now has docstrings.
1618

1719
- Issue #5981: Fix three minor inf/nan issues in float.fromhex:

Modules/_io/fileio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
223223
PyErr_Clear();
224224
}
225225

226-
#ifdef Py_WIN_WIDE_FILENAMES
226+
#ifdef MS_WINDOWS
227227
if (GetVersion() < 0x80000000) {
228228
/* On NT, so wide API available */
229229
if (PyUnicode_Check(nameobj))

Modules/posixmodule.c

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,13 @@ posix_error_with_filename(char* name)
581581
return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
582582
}
583583

584-
#ifdef Py_WIN_WIDE_FILENAMES
584+
#ifdef MS_WINDOWS
585585
static PyObject *
586586
posix_error_with_unicode_filename(Py_UNICODE* name)
587587
{
588588
return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name);
589589
}
590-
#endif /* Py_WIN_WIDE_FILENAMES */
590+
#endif /* MS_WINDOWS */
591591

592592

593593
static PyObject *
@@ -615,7 +615,6 @@ win32_error(char* function, char* filename)
615615
return PyErr_SetFromWindowsErr(errno);
616616
}
617617

618-
#ifdef Py_WIN_WIDE_FILENAMES
619618
static PyObject *
620619
win32_error_unicode(char* function, Py_UNICODE* filename)
621620
{
@@ -644,9 +643,7 @@ convert_to_unicode(PyObject **param)
644643
return (*param) != NULL;
645644
}
646645

647-
#endif /* Py_WIN_WIDE_FILENAMES */
648-
649-
#endif
646+
#endif /* MS_WINDOWS */
650647

651648
#if defined(PYOS_OS2)
652649
/**********************************************************************
@@ -745,7 +742,7 @@ posix_fildes(PyObject *fdobj, int (*func)(int))
745742
return Py_None;
746743
}
747744

748-
#ifdef Py_WIN_WIDE_FILENAMES
745+
#ifdef MS_WINDOWS
749746
static int
750747
unicode_file_names(void)
751748
{
@@ -808,7 +805,7 @@ posix_2str(PyObject *args,
808805
return Py_None;
809806
}
810807

811-
#ifdef Py_WIN_WIDE_FILENAMES
808+
#ifdef MS_WINDOWS
812809
static PyObject*
813810
win32_1str(PyObject* args, char* func,
814811
char* format, BOOL (__stdcall *funcA)(LPCSTR),
@@ -1564,7 +1561,6 @@ IsUNCRootA(char *path, int pathlen)
15641561
#undef ISSLASH
15651562
}
15661563

1567-
#ifdef Py_WIN_WIDE_FILENAMES
15681564
static BOOL
15691565
IsUNCRootW(Py_UNICODE *path, int pathlen)
15701566
{
@@ -1587,7 +1583,6 @@ IsUNCRootW(Py_UNICODE *path, int pathlen)
15871583

15881584
#undef ISSLASH
15891585
}
1590-
#endif /* Py_WIN_WIDE_FILENAMES */
15911586
#endif /* MS_WINDOWS */
15921587

15931588
static PyObject *
@@ -1607,7 +1602,7 @@ posix_do_stat(PyObject *self, PyObject *args,
16071602
int res;
16081603
PyObject *result;
16091604

1610-
#ifdef Py_WIN_WIDE_FILENAMES
1605+
#ifdef MS_WINDOWS
16111606
/* If on wide-character-capable OS see if argument
16121607
is Unicode and if so use wide API. */
16131608
if (unicode_file_names()) {
@@ -1670,7 +1665,7 @@ posix_access(PyObject *self, PyObject *args)
16701665
char *path;
16711666
int mode;
16721667

1673-
#ifdef Py_WIN_WIDE_FILENAMES
1668+
#ifdef MS_WINDOWS
16741669
DWORD attr;
16751670
if (unicode_file_names()) {
16761671
PyUnicodeObject *po;
@@ -1827,7 +1822,7 @@ posix_chmod(PyObject *self, PyObject *args)
18271822
char *path = NULL;
18281823
int i;
18291824
int res;
1830-
#ifdef Py_WIN_WIDE_FILENAMES
1825+
#ifdef MS_WINDOWS
18311826
DWORD attr;
18321827
if (unicode_file_names()) {
18331828
PyUnicodeObject *po;
@@ -1878,7 +1873,7 @@ posix_chmod(PyObject *self, PyObject *args)
18781873
release_bytes(opath);
18791874
Py_INCREF(Py_None);
18801875
return Py_None;
1881-
#else /* Py_WIN_WIDE_FILENAMES */
1876+
#else /* MS_WINDOWS */
18821877
if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter,
18831878
&opath, &i))
18841879
return NULL;
@@ -2128,7 +2123,7 @@ posix_getcwd(int use_bytes)
21282123
char buf[1026];
21292124
char *res;
21302125

2131-
#ifdef Py_WIN_WIDE_FILENAMES
2126+
#ifdef MS_WINDOWS
21322127
if (!use_bytes && unicode_file_names()) {
21332128
wchar_t wbuf[1026];
21342129
wchar_t *wbuf2 = wbuf;
@@ -2233,7 +2228,6 @@ posix_listdir(PyObject *self, PyObject *args)
22332228
char *bufptr = namebuf;
22342229
Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */
22352230

2236-
#ifdef Py_WIN_WIDE_FILENAMES
22372231
/* If on wide-character-capable OS see if argument
22382232
is Unicode and if so use wide API. */
22392233
if (unicode_file_names()) {
@@ -2316,7 +2310,6 @@ posix_listdir(PyObject *self, PyObject *args)
23162310
are also valid. */
23172311
PyErr_Clear();
23182312
}
2319-
#endif
23202313

23212314
if (!PyArg_ParseTuple(args, "O&:listdir",
23222315
PyUnicode_FSConverter, &opath))
@@ -2553,7 +2546,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
25532546
char *path;
25542547
char outbuf[MAX_PATH*2];
25552548
char *temp;
2556-
#ifdef Py_WIN_WIDE_FILENAMES
2549+
#ifdef MS_WINDOWS
25572550
if (unicode_file_names()) {
25582551
PyUnicodeObject *po;
25592552
if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
@@ -2615,7 +2608,7 @@ posix_mkdir(PyObject *self, PyObject *args)
26152608
char *path;
26162609
int mode = 0777;
26172610

2618-
#ifdef Py_WIN_WIDE_FILENAMES
2611+
#ifdef MS_WINDOWS
26192612
if (unicode_file_names()) {
26202613
PyUnicodeObject *po;
26212614
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.");
29212914
static PyObject *
29222915
posix_utime(PyObject *self, PyObject *args)
29232916
{
2924-
#ifdef Py_WIN_WIDE_FILENAMES
2917+
#ifdef MS_WINDOWS
29252918
PyObject *arg;
29262919
PyUnicodeObject *obwpath;
29272920
wchar_t *wpath = NULL;
@@ -3001,7 +2994,7 @@ posix_utime(PyObject *self, PyObject *args)
30012994
done:
30022995
CloseHandle(hFile);
30032996
return result;
3004-
#else /* Py_WIN_WIDE_FILENAMES */
2997+
#else /* MS_WINDOWS */
30052998

30062999
PyObject *opath;
30073000
char *path;
@@ -3077,7 +3070,7 @@ posix_utime(PyObject *self, PyObject *args)
30773070
#undef UTIME_ARG
30783071
#undef ATIME
30793072
#undef MTIME
3080-
#endif /* Py_WIN_WIDE_FILENAMES */
3073+
#endif /* MS_WINDOWS */
30813074
}
30823075

30833076

@@ -6803,7 +6796,7 @@ win32_startfile(PyObject *self, PyObject *args)
68036796
char *filepath;
68046797
char *operation = NULL;
68056798
HINSTANCE rc;
6806-
#ifdef Py_WIN_WIDE_FILENAMES
6799+
68076800
if (unicode_file_names()) {
68086801
PyObject *unipath, *woperation = NULL;
68096802
if (!PyArg_ParseTuple(args, "U|s:startfile",
@@ -6838,7 +6831,6 @@ win32_startfile(PyObject *self, PyObject *args)
68386831
Py_INCREF(Py_None);
68396832
return Py_None;
68406833
}
6841-
#endif
68426834

68436835
normal:
68446836
if (!PyArg_ParseTuple(args, "O&|s:startfile",

PC/pyconfig.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
558558
/* This is enough for unicodeobject.h to do the "right thing" on Windows. */
559559
#define Py_UNICODE_SIZE 2
560560

561-
/* Define to indicate that the Python Unicode representation can be passed
562-
as-is to Win32 Wide API. */
563-
#define Py_WIN_WIDE_FILENAMES
564-
565561
/* Use Python's own small-block memory-allocator. */
566562
#define WITH_PYMALLOC 1
567563

Python/errors.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
461461
return result;
462462
}
463463

464-
#ifdef Py_WIN_WIDE_FILENAMES
464+
#ifdef MS_WINDOWS
465465
PyObject *
466466
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
467467
{
@@ -472,7 +472,7 @@ PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
472472
Py_XDECREF(name);
473473
return result;
474474
}
475-
#endif /* Py_WIN_WIDE_FILENAMES */
475+
#endif /* MS_WINDOWS */
476476

477477
PyObject *
478478
PyErr_SetFromErrno(PyObject *exc)
@@ -549,7 +549,6 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
549549
return ret;
550550
}
551551

552-
#ifdef Py_WIN_WIDE_FILENAMES
553552
PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
554553
PyObject *exc,
555554
int ierr,
@@ -564,7 +563,6 @@ PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
564563
Py_XDECREF(name);
565564
return ret;
566565
}
567-
#endif /* Py_WIN_WIDE_FILENAMES */
568566

569567
PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
570568
{
@@ -588,7 +586,6 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
588586
return result;
589587
}
590588

591-
#ifdef Py_WIN_WIDE_FILENAMES
592589
PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
593590
int ierr,
594591
const Py_UNICODE *filename)
@@ -602,7 +599,6 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
602599
Py_XDECREF(name);
603600
return result;
604601
}
605-
#endif /* Py_WIN_WIDE_FILENAMES */
606602
#endif /* MS_WINDOWS */
607603

608604
void

0 commit comments

Comments
 (0)