Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 3a54dd5

Browse files
[client] utf-8 charset is compatible when using binary mode
1 parent 9b984ec commit 3a54dd5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

pycti/api/opencti_api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def upload_file(self, **kwargs):
629629
}
630630
"""
631631
if data is None:
632-
data = open(file_name, "rb", encoding="utf-8")
632+
data = open(file_name, "rb")
633633
if file_name.endswith(".json"):
634634
mime_type = "application/json"
635635
else:
@@ -664,7 +664,7 @@ def upload_pending_file(self, **kwargs):
664664
}
665665
"""
666666
if data is None:
667-
data = open(file_name, "rb", encoding="utf-8")
667+
data = open(file_name, "rb")
668668
if file_name.endswith(".json"):
669669
mime_type = "application/json"
670670
else:

pycti/entities/opencti_external_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def add_file(self, **kwargs):
235235
}
236236
"""
237237
if data is None:
238-
data = open(file_name, "rb", encoding="utf-8")
238+
data = open(file_name, "rb")
239239
if file_name.endswith(".json"):
240240
mime_type = "application/json"
241241
else:

pycti/entities/opencti_stix_cyber_observable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def add_file(self, **kwargs):
488488
}
489489
"""
490490
if data is None:
491-
data = open(file_name, "rb", encoding="utf-8")
491+
data = open(file_name, "rb")
492492
if file_name.endswith(".json"):
493493
mime_type = "application/json"
494494
else:
@@ -1300,7 +1300,7 @@ def upload_artifact(self, **kwargs):
13001300
}
13011301
"""
13021302
if data is None:
1303-
data = open(file_name, "rb", encoding="utf-8")
1303+
data = open(file_name, "rb")
13041304
if file_name.endswith(".json"):
13051305
mime_type = "application/json"
13061306
else:

pycti/entities/opencti_stix_domain_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ def add_file(self, **kwargs):
815815
}
816816
"""
817817
if data is None:
818-
data = open(file_name, "rb", encoding="utf-8")
818+
data = open(file_name, "rb")
819819
if file_name.endswith(".json"):
820820
mime_type = "application/json"
821821
else:

0 commit comments

Comments
 (0)