-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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
Labels
No labels