@@ -50,7 +50,7 @@ def _get(connection, attr, data, squeeze, download_path):
50
50
adapt = attr .adapter .get if attr .adapter else lambda x : x
51
51
52
52
if attr .is_filepath :
53
- return str ( adapt (extern .download_filepath (uuid .UUID (bytes = data ))[0 ]) )
53
+ return adapt (extern .download_filepath (uuid .UUID (bytes = data ))[0 ])
54
54
55
55
if attr .is_attachment :
56
56
# Steps:
@@ -65,22 +65,22 @@ def _get(connection, attr, data, squeeze, download_path):
65
65
if local_filepath .is_file ():
66
66
attachment_checksum = _uuid if attr .is_external else hash .uuid_from_buffer (data )
67
67
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
69
69
# generate the next available alias filename
70
70
for n in itertools .count ():
71
71
f = local_filepath .parent / (local_filepath .stem + '_%04x' % n + local_filepath .suffix )
72
72
if not f .is_file ():
73
73
local_filepath = f
74
74
break
75
75
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
77
77
# Save attachment
78
78
if attr .is_external :
79
79
extern .download_attachment (_uuid , attachment_name , local_filepath )
80
80
else :
81
81
# write from buffer
82
82
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
84
84
85
85
return adapt (uuid .UUID (bytes = data ) if attr .uuid else (
86
86
blob .unpack (extern .get (uuid .UUID (bytes = data )) if attr .is_external else data , squeeze = squeeze )
0 commit comments