Skip to content

Problem with loading .geof file from MAP repository #1

@NataCalc

Description

@NataCalc

Hello Ju,

I am experiencing problem with loading .geof files from MAP repository using load_geometric_field and load_gf_shelve functions. Attempt is to load filename=femur/baseline-214/fieldwork_mesh/femur_right_mean_cortex_outer_rigid_214.geof . As load_geometric_field function contains if open(filename) else shelve.open(filename) I am testing .geof file launching python via terminal:

(base) sxxxx:~$ python
Python 3.8.3 (default, Jul  2 2020, 11:26:31) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>import os
>>>import shelve
>>> f=open(filename, 'r')
>>> head = f.read(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/lib/python3.8/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9e in position 60: invalid start byte
 
>>> f=open(filename, 'rb')
>>> head = f.read(1) —————————>>>>>**working however the next step using ‘r’ or ‘rb’ fails.** 

 
 >>> S = shelve.open(filename, 'r' )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/lib/python3.8/shelve.py", line 243, in open
    return DbfilenameShelf(filename, flag, protocol, writeback)
  File "/opt/anaconda3/lib/python3.8/shelve.py", line 227, in __init__
    Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
  File "/opt/anaconda3/lib/python3.8/dbm/__init__.py", line 89, in open
    raise error[0]("db type could not be determined")
dbm.error: db type could not be determined

Thanks,
Nataliya

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions