Skip to content

Commit 7e972d0

Browse files
fix: replace file.read by file directly in add_folder
1 parent c94e356 commit 7e972d0

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

hrflow/profile/parsing.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,15 @@ def add_folder(
144144
for file_path in files_to_send:
145145
filename = os.path.basename(file_path)
146146
try:
147-
with open(file_path, "rb") as f:
148-
profile_file = f.read()
149-
resp = self.add_file(
150-
source_key=source_key,
151-
profile_file=profile_file,
152-
profile_file_name=filename,
153-
created_at=created_at,
154-
sync_parsing=sync_parsing,
155-
**kwargs,
156-
)
147+
with open(file_path, "rb") as file:
148+
resp = self.add_file(
149+
source_key=source_key,
150+
profile_file=file,
151+
profile_file_name=filename,
152+
created_at=created_at,
153+
sync_parsing=sync_parsing,
154+
**kwargs,
155+
)
157156
response_code = str(resp["code"]) # 200, 201, 202, 400, ...
158157
if response_code[0] != "2":
159158
failed_upload[file_path] = ValueError(

0 commit comments

Comments
 (0)