From d3f61335ddde2a17d4fd4d75a674df634de06dce Mon Sep 17 00:00:00 2001 From: San <43279026+nagasanjay@users.noreply.github.com> Date: Fri, 23 Oct 2020 13:41:34 +0530 Subject: [PATCH] osm-xodr conversion encoding correction (#3421) * open .osm with utf-8 encoding enabled As the .osm files are utf-8 encoded, it was raising errors while running the config.py script. Added the parameter `encoding='utf-8'` to solve it. * Update CHANGELOG.md Co-authored-by: Axel1092 <35765780+Axel1092@users.noreply.github.com> --- CHANGELOG.md | 3 ++- PythonAPI/util/config.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a628e5108..1de0dadcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ * Fixed the `actor.set_simulate_physics()` for pedestrians and vehicles * Fixed bug causing camera-based sensors to stop sending data * Fixed dependency of library **Xerces-c** on package - + * Fixed the `config.py` to read the `.osm ` files in proper `utf-8` encoding + ## CARLA 0.9.10 * Added retrieval of bounding boxes for all the elements of the level diff --git a/PythonAPI/util/config.py b/PythonAPI/util/config.py index 2b74ad5b5..9d61a9d5a 100755 --- a/PythonAPI/util/config.py +++ b/PythonAPI/util/config.py @@ -206,7 +206,7 @@ def main(): world = client.reload_world() elif args.xodr_path is not None: if os.path.exists(args.xodr_path): - with open(args.xodr_path) as od_file: + with open(args.xodr_path, encoding='utf-8') as od_file: try: data = od_file.read() except OSError: