Skip to content
Snippets Groups Projects
Commit a6dfdf0c authored by Stefano Nardo's avatar Stefano Nardo Committed by Ugo Albanese
Browse files

Merged in NRRPLT-8142-unable-to-add-a-custom-model (pull request #121)

[NRRPLT-8142] Open binary files in binary mode.

Approved-by: Ugo Albanese
parent df46e561
No related branches found
No related tags found
No related merge requests found
......@@ -275,7 +275,7 @@ class CLEGazeboSimulationAssembly(GazeboSimulationAssembly): # pylint: disable=
if not os.path.exists(os.path.dirname(brain_abs_zip_path)):
os.makedirs(os.path.dirname(brain_abs_zip_path))
with open(brain_abs_zip_path, 'w') as brain_zip:
with open(brain_abs_zip_path, 'wb') as brain_zip:
brain_zip.write(storage_brain_zip_data)
# Extract and flatten
# FixME: not sure exactly why flattening is required
......
......@@ -344,7 +344,7 @@ class RobotCallHandler(object):
try:
if not os.path.exists(save_to):
os.makedirs(save_to)
with open(os.path.join(save_to, save_as), 'w') as destAbsPath:
with open(os.path.join(save_to, save_as), 'wb') as destAbsPath:
destAbsPath.write(data)
except IOError as ex:
logger.error("Could not write downloaded SDF %s in directory %s due to %s",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment