Skip to content

Commit a7d7c1a

Browse files
authored
Merge pull request #157 from larsewi/cross
Fixed cross-device link error by downloading to target directory
2 parents eb99f83 + 7d5d36f commit a7d7c1a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

cf_remote/web.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def has_downloaded_package(path, filename, checksum, insecure):
6363

6464

6565
def download_package(url, path=None, checksum=None, insecure=False):
66-
print(insecure)
6766
assert path is None or type(path) is str and len(path) > 0
6867

6968
if checksum and not SHA256_RE.match(checksum):
@@ -85,7 +84,7 @@ def download_package(url, path=None, checksum=None, insecure=False):
8584
return path
8685

8786
print("Downloading package: '{}'".format(path))
88-
fd, tmp = tempfile.mkstemp()
87+
fd, tmp = tempfile.mkstemp(dir=os.path.dirname(path))
8988
answer = urllib.request.urlopen(url).read()
9089
os.write(fd, answer)
9190
os.close(fd)

0 commit comments

Comments
 (0)