https://github.com/python/cpython
Revision b942707fc23454a998323c17e30be78ff1a4f0e7 authored by BNMetrics on 02 November 2018, 15:20:19 UTC, committed by Pablo Galindo on 02 November 2018, 15:20:19 UTC
Some methods in the os module can accept path-like objects. This is documented in the general documentation but not in the function docstrings. To keep both in sync, the docstrings need to be updated to reflect that path-like objects are also accepted.
1 parent 488c0a6
Raw File
Tip revision: b942707fc23454a998323c17e30be78ff1a4f0e7 authored by BNMetrics on 02 November 2018, 15:20:19 UTC
bpo-29341: Clarify that path-like objects are accepted in some os methods (GH-10101)
Tip revision: b942707
generrmap.c
#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include <stdio.h>
#include <errno.h>

/* Extract the mapping of Win32 error codes to errno */

int main()
{
    int i;
    _setmode(fileno(stdout), O_BINARY);
    printf("/* Generated file. Do not edit. */\n");
    printf("int winerror_to_errno(int winerror)\n");
    printf("{\n    switch(winerror) {\n");
    for(i=1; i < 65000; i++) {
        _dosmaperr(i);
        if (errno == EINVAL) {
            /* Issue #12802 */
            if (i == ERROR_DIRECTORY)
                errno = ENOTDIR;
            /* Issue #13063 */
            else if (i == ERROR_NO_DATA)
                errno = EPIPE;
            else
                continue;
        }
        printf("        case %d: return %d;\n", i, errno);
    }
    printf("        default: return EINVAL;\n");
    printf("    }\n}\n");
}
back to top