Skip to content

Commit 6c00031

Browse files
Fix string return in adapted types + update tests to python3.8.
1 parent 6f367d1 commit 6c00031

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ services:
1313
main: &main
1414
stage: Alpine
1515
os: linux
16+
dist: bionic # precise, trusty, xenial, bionic
1617
language: shell
1718
script:
1819
- docker-compose -f LNX-docker-compose.yml up --build --exit-code-from dj
1920
jobs:
2021
include:
2122
- <<: *main
2223
env:
23-
- PY_VER: "3.8-rc"
24+
- PY_VER: "3.8"
2425
- MYSQL_VER: "5.7"
2526
- <<: *main
2627
env:
@@ -36,7 +37,7 @@ jobs:
3637
- MYSQL_VER: "5.7"
3738
- <<: *main
3839
env:
39-
- PY_VER: "3.8-rc"
40+
- PY_VER: "3.8"
4041
- MYSQL_VER: "8.0"
4142
- <<: *main
4243
env:
@@ -52,7 +53,7 @@ jobs:
5253
- MYSQL_VER: "8.0"
5354
- <<: *main
5455
env:
55-
- PY_VER: "3.8-rc"
56+
- PY_VER: "3.8"
5657
- MYSQL_VER: "5.6"
5758
- <<: *main
5859
env:

datajoint/fetch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _get(connection, attr, data, squeeze, download_path):
5050
adapt = attr.adapter.get if attr.adapter else lambda x: x
5151

5252
if attr.is_filepath:
53-
return str(adapt(extern.download_filepath(uuid.UUID(bytes=data))[0]))
53+
return adapt(str(extern.download_filepath(uuid.UUID(bytes=data))[0]))
5454

5555
if attr.is_attachment:
5656
# Steps:
@@ -65,22 +65,22 @@ def _get(connection, attr, data, squeeze, download_path):
6565
if local_filepath.is_file():
6666
attachment_checksum = _uuid if attr.is_external else hash.uuid_from_buffer(data)
6767
if attachment_checksum == hash.uuid_from_file(local_filepath, init_string=attachment_name + '\0'):
68-
return str(adapt(local_filepath)) # checksum passed, no need to download again
68+
return adapt(str(local_filepath)) # checksum passed, no need to download again
6969
# generate the next available alias filename
7070
for n in itertools.count():
7171
f = local_filepath.parent / (local_filepath.stem + '_%04x' % n + local_filepath.suffix)
7272
if not f.is_file():
7373
local_filepath = f
7474
break
7575
if attachment_checksum == hash.uuid_from_file(f, init_string=attachment_name + '\0'):
76-
return str(adapt(f)) # checksum passed, no need to download again
76+
return adapt(str(f)) # checksum passed, no need to download again
7777
# Save attachment
7878
if attr.is_external:
7979
extern.download_attachment(_uuid, attachment_name, local_filepath)
8080
else:
8181
# write from buffer
8282
safe_write(local_filepath, data.split(b"\0", 1)[1])
83-
return str(adapt(local_filepath)) # download file from remote store
83+
return adapt(str(local_filepath)) # download file from remote store
8484

8585
return adapt(uuid.UUID(bytes=data) if attr.uuid else (
8686
blob.unpack(extern.get(uuid.UUID(bytes=data)) if attr.is_external else data, squeeze=squeeze)

0 commit comments

Comments
 (0)