Skip to content

fix: OSError is generated by os.rename #22 #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/adobe/pdfservices/operation/internal/io/file_ref_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import logging
import os
from io import BufferedWriter
from shutil import move

from adobe.pdfservices.operation.exception.exceptions import SdkException
from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants
Expand Down Expand Up @@ -45,7 +46,7 @@ def save_as(self, destination_file_path):
if not os.path.exists(dir):
os.mkdir(dir)
if not os.path.exists(abs_path):
os.rename(self._file_path, abs_path)
move(self._file_path, abs_path)
return
raise SdkException("Output file {file} exists".format(file=destination_file_path))
else:
Expand Down