-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explicitly state encoding for windows #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please fix it in other of our scripts too? We plan to make Windows a usable dev platform )
Do you mean in the other repos? I've fixed all of them in this repo :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rg -w open tools/python/
tools/python/check_store_metadata.py
126: with open(path, 'r') as f:
tools/python/mwm_downloader.py
61: with open(filename, 'wb') as f:
119: countries = json.load(open(str(countries_path), 'r'))
tools/python/city_radius.py
15: f = open(path, 'r')
tools/python/tts_languages.py
47: with open(strings_name, "r") as langs_file:
58: with open(hpp_name, "w") as hpp_file:
tools/python/routing/src/graph_scripts.py
17: fh = open(save_path, 'w')
53: fh = open(save_path, 'w')
tools/python/data/borders/__init__.py
30: with open(tar_lzma_path, mode="rb") as f:
36: with tarfile.open(fileobj=lzma_stream, mode="r") as tar:
tools/python/routing/run_heap_comparison_benchmark.py
25: with open(file, 'w') as f:
31: with open(log_file) as log_file_fh:
98: with open(routes_file) as routes_file_fh:
tools/python/data/borders/setup.py
35: with tarfile.open(fileobj=tar_stream, mode="w") as tar:
40: with lzma.open(TAR_LZMA_PATH, mode="w") as f:
tools/python/mwm/ft2osm.py
101: with open(path, "rb") as f:
tools/python/mwm/mwm_python.py
24: self.f = open(filename, "rb")
tools/python/post_generation/__main__.py
102: with open(args.output, "w") as f:
142: with open(args.countries) as f:
154: with open(args.output, "w") as f:
tools/python/taxi_csv_to_json.py
44: with open(src_path, "r") as f:
67: with open(dst_path, "w") as f:
tools/python/convert_strings.py
94: fout = sys.stdout if options.output == '-' else open(options.output, 'w')
tools/python/post_generation/inject_promo_ids.py
111: with open(path) as f:
126: with open(osm2ft_name, "rb") as f:
tools/python/clean_strings_txt.py
385: with open(a_path) as infile:
tools/python/planet_checks/validate_big_cities.py
91: with open(reference_geojson_filename) as f:
tools/python/planet_checks/validate_continents.py
182: with open(options.continents_reference) as f:
199: with open(options.output, 'w') as f:
tools/python/road_runner.py
42: with open(path, "r") as f:
105:with open(os.path.join(sys.argv[1], "ways.csv"),"w") as f:
tools/python/categories_merge_language.py
18:with open(path, 'r') as f:
tools/python/planet_checks/validate_countries.py
534: with open(reference_countries_file) as f:
546: with open(whitelist_file) as f:
591: with open(options.output, 'w') as f:
tools/python/mwm/feature_types.py
13: with open(os.path.join(resource_path, "types.txt")) as f:
tools/python/post_generation/hierarchy_to_countries.py
44: with open(filename, "rb") as f:
86: with open(old_vs_new_csv_path) as f:
102: with open(borders_vs_osm_csv_path) as f:
118: with open(countries_synonyms_csv_path) as f:
151: with open(hierarchy_path) as f:
tools/python/booking_hotels_quality.py
26: with open(path, 'r') as fd:
37: with open(path, 'r') as fd:
tools/python/mixed_to_geojson.py
43: with open(OSM_CACHE, 'r') as f:
98: with open(OSM_CACHE, 'w') as f:
191:with open(options.txt, 'r') as f:
tools/python/airmaps/sandbox/airmaps/airflow.cfg
381:# the port on which the logs are served. It needs to be unused, and open
tools/python/transit/transit_graph_generator.py
403: with open(args.input_file, 'r') as input_file:
406: with open(args.colors, 'r') as colors_file:
417: with open(output_file, 'w') as json_file:
tools/python/transit/gtfs/download_gtfs.py
42: with open(os.path.join(path, RAW_FILE_MOBILITYDB), 'wb') as csv_file:
56: file = open(os.path.join(path, RAW_FILE_MOBILITYDB), encoding='UTF-8')
150: with open(path, "w") as out:
179: urls = [url.strip() for url in open(os.path.join(path, urls_file))]
tools/python/transit/transit_colors_export.py
19: with open(args.in_out_file, 'r') as in_file:
25: with open(args.colors, 'r') as colors_file:
32: with open(args.in_out_file, 'w') as out_file:
tools/python/testlog_to_xml_converter.py
124: with open(self.logfile) as f:
tools/python/categories_converter.py
70: with open(self.filepath) as infile:
93: with open(filepath, "w") as outfile:
120: with open(self.filepath, "w") as outfile:
tools/python/InstrumentsTraceParser.py
27: with open(file_path, "r") as f:
tools/python/po_parser.py
64: with open(filepath) as infile:
tools/python/descriptions/descriptions_downloader.py
98: for line in open(path):
193: with open(path, "w") as file:
250: with open(input_file) as file:
304: with open(input_file) as file:
tools/python/strings_utils.py
67: with open(self.strings_path, encoding='utf-8') as strings:
335: with open(target_file, "w", encoding='utf-8') as outfile:
tools/python/stylesheet/convert_styles.py
3:lns = open(sys.argv[1]).readlines()
tools/python/stylesheet/drules_info.py
22: for row in csv.reader(open(mapping_path), delimiter=';'):
31: drules.ParseFromString(open(drules_path).read())
tools/python/stylesheet/drules_dump.py
12:drules.ParseFromString(open(sys.argv[1]).read())
tools/python/stylesheet/cat_stat.py
124: drules.ParseFromString(open(os.path.join(data_path, DRULES_FILE_NAME), 'rb').read())
147: with open(os.path.join(data_path, 'mapcss-mapping.csv'), 'r') as f:
tools/python/stylesheet/drules_merge.py
113: drules1.ParseFromString(open(sys.argv[1], mode='rb').read())
115: drules2.ParseFromString(open(sys.argv[2], mode='rb').read())
122: with open(sys.argv[3], 'wb') as f:
125: with open(sys.argv[4], 'wb') as f:
tools/python/stylesheet/webcolors/setup.py
8: long_description=open(os.path.join(os.path.dirname(__file__), 'README.txt')).read(),
tools/python/stylesheet/drules_to_mapcss.py
87: for row in csv.reader(open(files['mapcss_mapping']), delimiter=';'):
108: drules.ParseFromString(open(files["drules_proto"]).read())
tools/python/strings_txt_from_csv.py
12: To use this script, create the translated strings using the google spread-sheet. Go to file -> Download as, and choose csv. Only the currently open sheet will be exported.
23:with open(path, mode='r') as infile:
tools/python/opentable_restaurants.py
39: with open(self.opentable_filename, 'w') as f:
116: data = open(args.opentable_data)
117: tsv = open(args.tsv, 'w') if args.tsv else sys.stdout
tools/python/maps_generator/__main__.py
209: with open(line) as f:
244: with open(options.order) as file:
tools/python/maps_generator/check_logs.py
55: file=open(args.output, "w") if args.output else sys.stdout,
tools/python/maps_generator/check_mwms.py
60: file=open(args.output, "w") if args.output else sys.stdout,
tools/python/maps_generator/generator/status.py
38: with open(self.stat_path, "w") as status:
42: with open(self.stat_path, "w") as status:
50: with open(self.stat_path) as status:
tools/python/maps_generator/utils/md5.py
6: with open(name, mode="rb") as f:
15: with open(name, mode="w") as f:
22: with open(name, "r") as f:
tools/python/maps_generator/generator/stages_declaration.py
352: with open(env.paths.counties_txt_path, "w") as f:
367: with tarfile.open(f"{env.paths.localads_path}.tar.gz", "w:gz") as tar:
379: with open(os.path.join(env.paths.stats_path, f"{country}.json")) as f:
389: with open(os.path.join(env.paths.stats_path, "stats.json"), "w") as f:
tools/python/maps_generator/utils/file.py
76: with open(tmp_name, "wb") as handle:
tools/python/maps_generator/generator/statistics.py
103: with open(config_path) as f:
105: with open(stats_path) as f:
131: with open(path) as f:
151: with open(path) as f:
tools/python/maps_generator/generator/steps.py
425: with open(os.path.join(env.paths.stats_path, f"{country}.json"), "w") as f:
tools/python/maps_generator/generator/stages_tests.py
18: with open(meta_path) as f:
tools/python/maps_generator/generator/env.py
74: with open(os.path.join(out_path, settings.VERSION_FILE_NAME), "w") as f:
79: with open(version_path) as f:
tools/python/maps_generator/update_generation_order.py
38: with open(args.output, "w") as out:
tools/python/maps_generator/tests/test_logs_reader.py
15: with open(
tools/python/maps_generator/checks/check_categories.py
10: with open(path) as f:
tools/python/maps_generator/checks/logs/logs_reader.py
94: with self.path.open() as logfile:
hopefully fixes building map styles on windows (organicmaps/organicmaps#4299)
( needs testing on windows, but works fine on mac)