bigbang
bigbang copied to clipboard
collect-draft-metadata errors
While working on #585 I found an error in bin/collect_draft_metadata.py
:
$ python bin/collect_draft_metadata.py -w hrpc
Exception ignored in: <function DataTracker.__del__ at 0x1105f9b40>
Traceback (most recent call last):
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/ietfdata/datatracker.py", line 1846, in __del__
self.session.close()
AttributeError: 'DataTracker' object has no attribute 'session'
Traceback (most recent call last):
File "/Users/user/code/bigbang/bin/collect_draft_metadata.py", line 110, in <module>
main(args)
File "/Users/user/code/bigbang/bin/collect_draft_metadata.py", line 104, in main
collect_drafts(args.w)
File "/Users/user/code/bigbang/bin/collect_draft_metadata.py", line 54, in collect_drafts
dt = DataTracker(cache_dir=Path("cache"))
TypeError: DataTracker.__init__() got an unexpected keyword argument 'cache_dir'
It looks like the DataTracker
constructor (in ietfdata) doesn't support cache_dir
, at least the version that I installed.
When I migrated this over to the CLI in #585, I started to try to fix it simply by removing the cache_dir
keyword argument. It gets farther this time, but some code inside the ietfdata
module throws an exception:
$ bigbang collect-draft-metadata --working-group hrpc
Traceback (most recent call last):
File "/Users/user/code/bigbang/env/bin/bigbang", line 8, in <module>
sys.exit(main_cli())
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/bigbang/cli.py", line 125, in collect_draft_metadata
group = dt.group_from_acronym(wg)
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/ietfdata/datatracker.py", line 2728, in group_from_acronym
groups = list(self._retrieve_multi(url, Group))
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/ietfdata/datatracker.py", line 2086, in _retrieve_multi
fetch_obj = self.pavlova.from_mapping(obj_json, obj_type) # type: T
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/pavlova/__init__.py", line 102, in from_mapping
data[field.name] = self.parse_field(
File "/Users/user/code/bigbang/env/lib/python3.10/site-packages/pavlova/__init__.py", line 150, in parse_field
return self.parsers[base_type].parse_input(
KeyError: typing.Optional