mirage / irmin-py

ISC License
5 stars 2 forks source link

Crash in `Metadata.__str__` #2

Closed Ngoguey42 closed 2 years ago

Ngoguey42 commented 2 years ago

This snippet triggers an exception (i'm using ipython).

%run examples/tezos.py /Users/nico/tz/hangzu_plus2_imported_context CoV6QV47kn2oRnTihfjAC3dKPfrjEZjojMXVEYBLPYM7EmFkDqdS
_ = commit.tree.get('protocol')
m = commit.tree.metadata('protocol')
str(m)
AttributeError                            Traceback (most recent call last)
<ipython-input-8-cfa5c278a5c6> in <module>
----> 1 str(commit.tree.metadata('protocol'))

~/r/irmin-py/irmin/irmin.py in __str__(self)
    629
    630     def __str__(self):
--> 631         t = Type.metadata(self.repo)
    632         return Value(self._metadata, t).to_string()
    633

~/r/irmin-py/irmin/irmin.py in metadata(repo)
    214         Metadata type for the given repo
    215         '''
--> 216         return Type(lib.irmin_typmetadata(repo._repo))
    217
    218     @property

~/anaconda3/envs/rb/lib/python3.9/site-packages/cffi/api.py in __getattr__(self, name)
    910     class FFILibrary(object):
    911         def __getattr__(self, name):
--> 912             make_accessor(name)
    913             return getattr(self, name)
    914         def __setattr__(self, name, value):

~/anaconda3/envs/rb/lib/python3.9/site-packages/cffi/api.py in make_accessor(name)
    905                 update_accessors()
    906                 if name not in accessors:
--> 907                     raise AttributeError(name)
    908             accessors[name](name)
    909     #

AttributeError: irmin_typmetadata

I'm using python 3.9.1 on macos (intel).

I'm using these sources irmin-py sources: