You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently on python3 if you're trying to stor.open() a file a DNAnexus, it will give a unicode error if you're opening a non-text (binary file).
Recently a PR was merged that adds an 'rb' mode for dxpy. Thus read_object() function in dx.py needs to be updated to reflect this.
For example, given a .png file that you want to view within jupyter notebook with DNAnexus id: project-abc:file-xyz
importstorimportdxpyfromPILimportImageimg=stor.Path('dx://project-abc:file-xyz')
withstor.open(img, "rb") asf:
display(Image.open(io.BytesIO(f.read()))) # this will give UnicodeDecodeErrorwithdxpy.DXFile(dxid='file-xyz', project='project-abc', mode='rb') asdp:
display(Image.open(io.BytesIO(dp.read()))) # this will workdxpy.__version__# '0.277.0+g18cd5634'
The text was updated successfully, but these errors were encountered:
Currently on python3 if you're trying to stor.open() a file a DNAnexus, it will give a unicode error if you're opening a non-text (binary file).
Recently a PR was merged that adds an 'rb' mode for dxpy. Thus
read_object()
function in dx.py needs to be updated to reflect this.For example, given a .png file that you want to view within jupyter notebook with DNAnexus id: project-abc:file-xyz
The text was updated successfully, but these errors were encountered: