Hi everyone!
I need to open IFC file from minio S3 storage like a bytes object
Ifc file is stored in minio S3 storage. I can read it with minio module and i get file in "bytes type" (see below)
open() expects the filename on disk as a python str not bytes.
If you have file content there is ifcopenshell.file.from_string() but it also expects a string so use ifcopenshell.file.from_string(ifcfile.read().decode('ascii'))
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone!
I need to open IFC file from minio S3 storage like a bytes object
Ifc file is stored in minio S3 storage. I can read it with minio module and i get file in "bytes type" (see below)
ifcfile = minioClient.get_object('nabievtest', 'OPU.ifc')
print(type(ifcfile.read()))
The file itself is correct, I check it with traditional way of open
But I can't read it this way from storage:
ifc_file = ifcopenshell.open(ifcfile.read())
Can you explain me what i doing wrong?
open()expects the filename on disk as a python str not bytes.If you have file content there is
ifcopenshell.file.from_string()but it also expects a string so useifcopenshell.file.from_string(ifcfile.read().decode('ascii'))It works, thanks!