mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merged revisions 67154,67157-67159,67175-67176,67189,67224-67227,67234 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67154 | hirokazu.yamamoto | 2008-11-07 21:46:17 -0600 (Fri, 07 Nov 2008) | 1 line Issue #4071: ntpath.abspath returned an empty string for long unicode path. ........ r67157 | georg.brandl | 2008-11-08 05:47:44 -0600 (Sat, 08 Nov 2008) | 2 lines Don't use "HOWTO" as the title for all howto .tex files. ........ r67158 | georg.brandl | 2008-11-08 05:48:20 -0600 (Sat, 08 Nov 2008) | 2 lines Update "Documenting" a bit. Concentrate on Python-specifics. ........ r67159 | georg.brandl | 2008-11-08 06:52:25 -0600 (Sat, 08 Nov 2008) | 2 lines Fix warning. ........ r67175 | benjamin.peterson | 2008-11-08 19:44:32 -0600 (Sat, 08 Nov 2008) | 1 line update link ........ r67176 | benjamin.peterson | 2008-11-08 19:52:32 -0600 (Sat, 08 Nov 2008) | 1 line fix comment ........ r67189 | benjamin.peterson | 2008-11-11 15:56:06 -0600 (Tue, 11 Nov 2008) | 1 line use correct name ........ r67224 | georg.brandl | 2008-11-15 02:10:04 -0600 (Sat, 15 Nov 2008) | 2 lines #4324: fix getlocale() argument. ........ r67225 | brett.cannon | 2008-11-15 16:33:25 -0600 (Sat, 15 Nov 2008) | 1 line Clarify the docs for the 'strict' argument to httplib.HTTPConnection. ........ r67226 | brett.cannon | 2008-11-15 16:40:44 -0600 (Sat, 15 Nov 2008) | 4 lines The docs for httplib.HTTPConnection.putheader() have claimed for quite a while that their could be an arbitrary number of values passed in. Turns out the code did not match that. The code now matches the docs. ........ r67227 | georg.brandl | 2008-11-16 02:00:17 -0600 (Sun, 16 Nov 2008) | 2 lines #4316: fix configure.in markup problem. ........ r67234 | benjamin.peterson | 2008-11-16 11:54:55 -0600 (Sun, 16 Nov 2008) | 1 line run autoconf ........
This commit is contained in:
parent
7d99f09f89
commit
f608c61301
14 changed files with 45 additions and 129 deletions
|
@ -2395,13 +2395,27 @@ posix__getfullpathname(PyObject *self, PyObject *args)
|
|||
if (unicode_file_names()) {
|
||||
PyUnicodeObject *po;
|
||||
if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
|
||||
Py_UNICODE woutbuf[MAX_PATH*2];
|
||||
Py_UNICODE *wpath = PyUnicode_AS_UNICODE(po);
|
||||
Py_UNICODE woutbuf[MAX_PATH*2], *woutbufp = woutbuf;
|
||||
Py_UNICODE *wtemp;
|
||||
if (!GetFullPathNameW(PyUnicode_AS_UNICODE(po),
|
||||
sizeof(woutbuf)/sizeof(woutbuf[0]),
|
||||
woutbuf, &wtemp))
|
||||
return win32_error("GetFullPathName", "");
|
||||
return PyUnicode_FromUnicode(woutbuf, wcslen(woutbuf));
|
||||
DWORD result;
|
||||
PyObject *v;
|
||||
result = GetFullPathNameW(wpath,
|
||||
sizeof(woutbuf)/sizeof(woutbuf[0]),
|
||||
woutbuf, &wtemp);
|
||||
if (result > sizeof(woutbuf)/sizeof(woutbuf[0])) {
|
||||
woutbufp = malloc(result * sizeof(Py_UNICODE));
|
||||
if (!woutbufp)
|
||||
return PyErr_NoMemory();
|
||||
result = GetFullPathNameW(wpath, result, woutbufp, &wtemp);
|
||||
}
|
||||
if (result)
|
||||
v = PyUnicode_FromUnicode(woutbufp, wcslen(woutbufp));
|
||||
else
|
||||
v = win32_error_unicode("GetFullPathNameW", wpath);
|
||||
if (woutbufp != woutbuf)
|
||||
free(woutbufp);
|
||||
return v;
|
||||
}
|
||||
/* Drop the argument parsing error as narrow strings
|
||||
are also valid. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue