Index: Modules/python.c =================================================================== --- Modules/python.c (revision 65930) +++ Modules/python.c (working copy) @@ -40,7 +40,15 @@ oldloc = setlocale(LC_ALL, NULL); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { +#ifdef __CYGWIN__ + /* Cygwin has a broken implementation of mbstowcs which does + * not count the characters that would result from conversion. + * Use an upper bound. + */ + size_t argsize = strlen(argv[i]); +#else size_t argsize = mbstowcs(NULL, argv[i], 0); +#endif if (argsize == (size_t)-1) { fprintf(stderr, "Could not convert argument %d to string", i); return 1;