Skip to content

Commit 5ab5e74

Browse files
committed
Use binary string to not change line endings when writing to file
Signed-off-by: paul.profizi <[email protected]>
1 parent bddf712 commit 5ab5e74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ansys/dpf/core/operators/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def build_operators():
216216

217217
# Write to operator file
218218
operator_file = os.path.join(category_path, scripting_name + ".py")
219-
with open(operator_file, "w") as f:
219+
with open(operator_file, "wb") as f:
220220
try:
221221
operator_str = build_operator(
222222
specification,
@@ -226,7 +226,7 @@ def build_operators():
226226
category,
227227
)
228228
exec(operator_str, globals())
229-
f.write(operator_str)
229+
f.write(operator_str.encode())
230230
succeeded += 1
231231
except SyntaxError as e:
232232
error_message = (

0 commit comments

Comments
 (0)