[New-bugs-announce] [issue5058] stop pgen.exe from generating CRLF-ended files and causing mayhem with win32-based patch submissions

Luke Kenneth Casson Leighton report at bugs.python.org
Sun Jan 25 19:15:01 CET 2009


New submission from Luke Kenneth Casson Leighton <lkcl at lkcl.net>:

diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
index fc27a2c..a4d4911 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -49,7 +49,7 @@ main(int argc, char **argv)
        graminit_h = argv[2];
        graminit_c = argv[3];
        g = getgrammar(filename);
-       fp = fopen(graminit_c, "w");
+       fp = fopen(graminit_c, "wb");
        if (fp == NULL) {
                perror(graminit_c);
                Py_Exit(1);
@@ -58,7 +58,7 @@ main(int argc, char **argv)
                printf("Writing %s ...\n", graminit_c);
        printgrammar(g, fp);
        fclose(fp);
-       fp = fopen(graminit_h, "w");
+       fp = fopen(graminit_h, "wb");
        if (fp == NULL) {
                perror(graminit_h);
                Py_Exit(1);
@@ -79,7 +79,7 @@ getgrammar(char *filename)
        grammar *g0, *g;
        perrdetail err;
        
-       fp = fopen(filename, "r");
+       fp = fopen(filename, "rb");
        if (fp == NULL) {
                perror(filename);
                Py_Exit(1);

----------
components: Build
messages: 80517
nosy: lkcl
severity: normal
status: open
title: stop pgen.exe from generating CRLF-ended files and causing mayhem with win32-based patch submissions
type: feature request
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5058>
_______________________________________


More information about the New-bugs-announce mailing list