Skip to content

Fix make_temp: revert fallback to working_directory #720

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
6 changes: 3 additions & 3 deletions devlib/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ async def write_value(self, path, value, verify=True, as_root=True):
raise

@asyn.asynccontextmanager
async def make_temp(self, is_directory=True, directory=None, prefix=None):
async def make_temp(self, is_directory=True, directory=None, prefix='devlib-test'):
"""
Creates temporary file/folder on target and deletes it once it's done.

Expand All @@ -1233,8 +1233,8 @@ async def make_temp(self, is_directory=True, directory=None, prefix=None):
:rtype: str
"""

directory = directory or self.tmp_directory
prefix = f'{prefix}-' if prefix else ''
directory = directory or self.working_directory
prefix = f'{prefix}-' if prefix else '-'
temp_obj = None
try:
cmd = f'mktemp -p {quote(directory)} {quote(prefix)}XXXXXX'
Expand Down