| LEFT | RIGHT |
|---|---|
| 1 | 1 |
| 2 /* POSIX module implementation */ | 2 /* POSIX module implementation */ |
| 3 | 3 |
| 4 /* This file is also used for Windows NT/MS-Win and OS/2. In that case the | 4 /* This file is also used for Windows NT/MS-Win and OS/2. In that case the |
| 5 module actually calls itself 'nt' or 'os2', not 'posix', and a few | 5 module actually calls itself 'nt' or 'os2', not 'posix', and a few |
| 6 functions are either unimplemented or implemented differently. The source | 6 functions are either unimplemented or implemented differently. The source |
| 7 assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent | 7 assumes that for Windows NT, the macro 'MS_WINDOWS' is defined independent |
| 8 of the compiler used. Different compilers define their own feature | 8 of the compiler used. Different compilers define their own feature |
| 9 test macro, e.g. '__BORLANDC__' or '_MSC_VER'. For OS/2, the compiler | 9 test macro, e.g. '__BORLANDC__' or '_MSC_VER'. For OS/2, the compiler |
| 10 independent macro PYOS_OS2 should be defined. On OS/2 the default | 10 independent macro PYOS_OS2 should be defined. On OS/2 the default |
| (...skipping 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2347 if (arg_is_unicode) { | 2347 if (arg_is_unicode) { |
| 2348 PyObject *w; | 2348 PyObject *w; |
| 2349 | 2349 |
| 2350 w = PyUnicode_FromEncodedObject(v, | 2350 w = PyUnicode_FromEncodedObject(v, |
| 2351 Py_FileSystemDefaultEncoding, | 2351 Py_FileSystemDefaultEncoding, |
| 2352 "strict"); | 2352 "strict"); |
| 2353 if (w != NULL) { | 2353 if (w != NULL) { |
| 2354 Py_DECREF(v); | 2354 Py_DECREF(v); |
| 2355 v = w; | 2355 v = w; |
| 2356 } | 2356 } |
| 2357 else { | 2357 else { |
|
GvR
2008/09/30 18:10:41
I'd like to see a comment here, e.g.
/* Ignore un
| |
| 2358 /* Ignore undecodable filenames, as discussed | |
| 2359 * in issue 3187. To include these, | |
| 2360 * use getcwdb(). */ | |
| 2358 PyErr_Clear(); | 2361 PyErr_Clear(); |
| 2359 Py_DECREF(v); | 2362 Py_DECREF(v); |
| 2360 continue; | 2363 continue; |
| 2361 } | 2364 } |
| 2362 } | 2365 } |
| 2363 if (PyList_Append(d, v) != 0) { | 2366 if (PyList_Append(d, v) != 0) { |
| 2364 Py_DECREF(v); | 2367 Py_DECREF(v); |
| 2365 Py_DECREF(d); | 2368 Py_DECREF(d); |
| 2366 d = NULL; | 2369 d = NULL; |
| 2367 break; | 2370 break; |
| (...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4447 PyObject *w; | 4450 PyObject *w; |
| 4448 | 4451 |
| 4449 w = PyUnicode_FromEncodedObject(v, | 4452 w = PyUnicode_FromEncodedObject(v, |
| 4450 Py_FileSystemDefaultEncoding, | 4453 Py_FileSystemDefaultEncoding, |
| 4451 "strict"); | 4454 "strict"); |
| 4452 if (w != NULL) { | 4455 if (w != NULL) { |
| 4453 Py_DECREF(v); | 4456 Py_DECREF(v); |
| 4454 v = w; | 4457 v = w; |
| 4455 } | 4458 } |
| 4456 else { | 4459 else { |
| 4457 » » » /* fall back to the original byte string, as | 4460 » » » v = NULL; |
| 4458 » » » discussed in patch #683592 */ | |
| 4459 » » » PyErr_Clear(); | |
| 4460 } | 4461 } |
| 4461 } | 4462 } |
| 4462 return v; | 4463 return v; |
| 4463 } | 4464 } |
| 4464 #endif /* HAVE_READLINK */ | 4465 #endif /* HAVE_READLINK */ |
| 4465 | 4466 |
| 4466 | 4467 |
| 4467 #ifdef HAVE_SYMLINK | 4468 #ifdef HAVE_SYMLINK |
| 4468 PyDoc_STRVAR(posix_symlink__doc__, | 4469 PyDoc_STRVAR(posix_symlink__doc__, |
| 4469 "symlink(src, dst)\n\n\ | 4470 "symlink(src, dst)\n\n\ |
| (...skipping 2968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7438 | 7439 |
| 7439 | 7440 |
| 7440 #endif /* __APPLE__ */ | 7441 #endif /* __APPLE__ */ |
| 7441 return m; | 7442 return m; |
| 7442 | 7443 |
| 7443 } | 7444 } |
| 7444 | 7445 |
| 7445 #ifdef __cplusplus | 7446 #ifdef __cplusplus |
| 7446 } | 7447 } |
| 7447 #endif | 7448 #endif |
| LEFT | RIGHT |