diff --git a/general/g.proj/input.c b/general/g.proj/input.c index 11c4549615e..046cb6ede44 100644 --- a/general/g.proj/input.c +++ b/general/g.proj/input.c @@ -122,6 +122,7 @@ int input_wkt(char *wktfile) <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -149,6 +150,10 @@ int input_wkt(char *wktfile) >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= >>>>>>> a2d9fb4362 (wxpyimgview: explicit conversion to int (#2704)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) size_t wktlen; wktlen = fread(buff, 1, sizeof(buff), infd); @@ -167,6 +172,7 @@ int input_wkt(char *wktfile) <<<<<<< HEAD <<<<<<< HEAD ======= +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> osgeo-main @@ -178,12 +184,15 @@ int input_wkt(char *wktfile) >>>>>>> 7c10386e82 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +<<<<<<< HEAD ======= ======= >>>>>>> 398a3c2388 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> 7c10386e82 (g.proj: fix reading input WKT (#1582)) >>>>>>> b845e8d135 (g.proj: fix reading input WKT (#1582)) +======= +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) size_t wktlen; wktlen = fread(buff, 1, sizeof(buff), infd); @@ -199,6 +208,9 @@ int input_wkt(char *wktfile) G_squeeze(buff); <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) >>>>>>> b3579a4902 (g.proj: fix reading input WKT (#1582)) ======= size_t wktlen; @@ -238,6 +250,7 @@ int input_wkt(char *wktfile) >>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD >>>>>>> osgeo-main ======= >>>>>>> osgeo-main @@ -254,6 +267,8 @@ int input_wkt(char *wktfile) ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> a2d9fb4362 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) } else G_fatal_error(_("Unable to open file '%s' for reading"), wktfile); diff --git a/python/grass/.flake8 b/python/grass/.flake8 index 39947dcfc55..74b6397097f 100644 --- a/python/grass/.flake8 +++ b/python/grass/.flake8 @@ -11,6 +11,7 @@ ignore = <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD <<<<<<< HEAD @@ -30,6 +31,10 @@ ignore = >>>>>>> b845e8d135 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> 29302c9ef8 (pythonlib: Remove star imports (#1546)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) ======= E722, # do not use bare 'except' >>>>>>> 7e8f036e2d (pythonlib: Remove star imports (#1546)) @@ -38,6 +43,9 @@ ignore = <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) ======= <<<<<<< HEAD <<<<<<< HEAD @@ -55,6 +63,7 @@ ignore = >>>>>>> 7e8f036e2d (pythonlib: Remove star imports (#1546)) >>>>>>> 57aff3a06a (pythonlib: Remove star imports (#1546)) <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) <<<<<<< HEAD @@ -78,6 +87,10 @@ ignore = >>>>>>> b845e8d135 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> 29302c9ef8 (pythonlib: Remove star imports (#1546)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) per-file-ignores = # C wrappers call libgis.G_gisinit before importing other modules. diff --git a/scripts/g.extension/g.extension.py b/scripts/g.extension/g.extension.py index 24c9a49471d..56d1a44c10c 100644 --- a/scripts/g.extension/g.extension.py +++ b/scripts/g.extension/g.extension.py @@ -746,6 +746,29 @@ def replace_shebang_win(python_file): os.rename(tmp_name, python_file) # rename temp to original name +def replace_shebang_win(python_file): + """ + Replaces "python" with "python3" in python files + using UTF8 encoding on MS Windows + """ + + cur_dir = os.path.dirname(python_file) + tmp_name = os.path.join(cur_dir, gscript.tempname(12)) + + with codecs.open(python_file, "r", encoding="utf8") as in_file, codecs.open( + tmp_name, "w", encoding="utf8" + ) as out_file: + + for line in in_file: + new_line = line.replace( + "#!/usr/bin/env python\n", "#!/usr/bin/env python3\n" + ) + out_file.write(new_line) + + os.remove(python_file) # remove original + os.rename(tmp_name, python_file) # rename temp to original name + + def urlretrieve(url, filename, *args, **kwargs): """Same function as 'urlretrieve', but with the ability to define headers.