Skip to content

Commit

Permalink
Patch 594001: PEP 277 - Unicode file name support for Windows NT.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhammond committed Oct 3, 2002
1 parent eb287a2 commit c2e85bd
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 44 deletions.
25 changes: 23 additions & 2 deletions Include/pyerrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,37 @@ PyAPI_DATA(PyObject *) PyExc_FutureWarning;
PyAPI_FUNC(int) PyErr_BadArgument(void);
PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrno(PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *);
#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */

PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...)
Py_GCC_ATTRIBUTE((format(printf, 2, 3)));

#ifdef MS_WINDOWS
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilenameObject(
int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
int, const char *);
#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
PyObject *,int, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
PyObject *,int, const char *);
#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *);
#endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif
#endif /* MS_WINDOWS */

/* Export the old function so that the existing API remains available: */
PyAPI_FUNC(void) PyErr_BadInternalCall(void);
Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_unicode_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
os.chmod(TESTFN_UNICODE, 0777)

# Test rename
try:
os.unlink(TESTFN_ENCODED + ".new")
except os.error:
pass
os.rename(TESTFN_ENCODED, TESTFN_ENCODED + ".new")
os.rename(TESTFN_UNICODE+".new", TESTFN_ENCODED)

Expand Down
Loading

0 comments on commit c2e85bd

Please sign in to comment.