This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: stop pgen.exe from generating CRLF-ended files and causing mayhem with win32-based patch submissions
Type: enhancement Stage:
Components: Build Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ggenellina, lkcl
Priority: normal Keywords:

Created on 2009-01-25 18:15 by lkcl, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg80517 - (view) Author: Luke Kenneth Casson Leighton (lkcl) Date: 2009-01-25 18:14
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);
msg80607 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-01-27 02:14
I don't understand the issue. Those files *are* text files, and have 
CRLF on Windows as expected, like all other text files.

I think you should fix your build process, or your environment, or your 
diff utility, or whatever is causing you a problem -- but not pgen.
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49308
2009-01-28 22:21:52amaury.forgeotdarcsetstatus: open -> closed
resolution: not a bug
2009-01-27 02:14:53ggenellinasetnosy: + ggenellina
messages: + msg80607
2009-01-25 18:15:00lkclcreate