diff --git a/general/g.proj/input.c b/general/g.proj/input.c index b12739ca93d..5eaa387d279 100644 --- a/general/g.proj/input.c +++ b/general/g.proj/input.c @@ -143,6 +143,7 @@ int input_wkt(char *wktfile) <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -238,6 +239,10 @@ int input_wkt(char *wktfile) >>>>>>> bc7152a288 (wxpyimgview: explicit conversion to int (#2704)) ======= >>>>>>> b5acd78515 (wxpyimgview: explicit conversion to int (#2704)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> c1a5635118 (g.proj: fix reading input WKT (#1582)) size_t wktlen; wktlen = fread(buff, 1, sizeof(buff), infd); @@ -359,9 +364,15 @@ int input_wkt(char *wktfile) ======= >>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582)) ======= +<<<<<<< HEAD ======= >>>>>>> 7c10386e82 (g.proj: fix reading input WKT (#1582)) +<<<<<<< HEAD >>>>>>> 9fb6588182 (g.proj: fix reading input WKT (#1582)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> c1a5635118 (g.proj: fix reading input WKT (#1582)) size_t wktlen; wktlen = fread(buff, 1, sizeof(buff), infd); @@ -388,6 +399,7 @@ int input_wkt(char *wktfile) <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582)) ======= @@ -410,6 +422,8 @@ int input_wkt(char *wktfile) >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> c1a5635118 (g.proj: fix reading input WKT (#1582)) >>>>>>> b3579a4902 (g.proj: fix reading input WKT (#1582)) ======= size_t wktlen; @@ -559,6 +573,7 @@ int input_wkt(char *wktfile) <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> main @@ -633,6 +648,8 @@ int input_wkt(char *wktfile) ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> b5acd78515 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> c1a5635118 (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 df39068361b..0ac9c495c1e 100644 --- a/python/grass/.flake8 +++ b/python/grass/.flake8 @@ -35,6 +35,7 @@ ignore = <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -110,6 +111,10 @@ ignore = >>>>>>> 9fb6588182 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> c5d3b09cb4 (pythonlib: Remove star imports (#1546)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> c1a5635118 (g.proj: fix reading input WKT (#1582)) ======= E722, # do not use bare 'except' >>>>>>> 7e8f036e2d (pythonlib: Remove star imports (#1546)) @@ -133,6 +138,9 @@ ignore = <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> c1a5635118 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> 95f198e1e0 (g.proj: fix reading input WKT (#1582)) ======= @@ -200,6 +208,7 @@ ignore = <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) <<<<<<< HEAD @@ -307,6 +316,10 @@ ignore = >>>>>>> 9fb6588182 (g.proj: fix reading input WKT (#1582)) ======= >>>>>>> c5d3b09cb4 (pythonlib: Remove star imports (#1546)) +======= +======= +>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582)) +>>>>>>> c1a5635118 (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 76afecb812e..0518e675016 100644 --- a/scripts/g.extension/g.extension.py +++ b/scripts/g.extension/g.extension.py @@ -1264,6 +1264,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.