Staging
v0.5.1
https://github.com/python/cpython
Revision 635743355d9dbffdc9aa7a2cc8de1403fbdb8d9b authored by Miss Islington (bot) on 17 July 2019, 17:29:18 UTC, committed by GitHub on 17 July 2019, 17:29:18 UTC

This exception was caused because the input ended unexpectedly with only one
single quote instead of a pair with some value inside it.
(cherry picked from commit 719a062bcb7b08a56e6576dcd75f4244e6053209)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
1 parent 6816ca3
Raw File
Tip revision: 635743355d9dbffdc9aa7a2cc8de1403fbdb8d9b authored by Miss Islington (bot) on 17 July 2019, 17:29:18 UTC
Fix IndexError when parsing unexpectedly ending quoted-string. (GH-14813)
Tip revision: 6357433
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