scieloorg / oai-pmh

Provedor da dados OAI-PMH para Rede SciELO
BSD 2-Clause "Simplified" License
2 stars 4 forks source link

AttributeError: 'str' object has no attribute 'get' #14

Closed gustavofonseca closed 7 years ago

gustavofonseca commented 7 years ago
2017-09-01 11:45:02,292 INFO  [articlemeta.client][waitress] Document loaded: scl_S2179-975X2011000300002
2017-09-01 11:45:02,295 ERROR [waitress][waitress] Exception when serving /
Traceback (most recent call last):
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/waitress/channel.py", line 338, in service
    task.service()
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/waitress/task.py", line 169, in service
    self.execute()
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/waitress/task.py", line 399, in execute
    app_iter = self.channel.server.application(env, start_response)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/router.py", line 233, in __call__
    response = self.invoke_subrequest(request, use_tweens=True)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/router.py", line 208, in invoke_subrequest
    response = handle_request(request)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/tweens.py", line 62, in excview_tween
    reraise(*attrs['exc_info'])
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/compat.py", line 148, in reraise
    raise value
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/tweens.py", line 22, in excview_tween
    response = handler(request)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/router.py", line 155, in handle_request
    view_name
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/view.py", line 612, in _call_view
    response = view_callable(context, request)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/viewderivers.py", line 409, in viewresult_to_response
    result = view(context, request)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/pyramid/viewderivers.py", line 147, in _requestonly_view
    response = view(request)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/views.py", line 14, in root
    body = request.repository.handle_request(request.query_string)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/repository.py", line 325, in handle_request
    return verb(oairequest)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/repository.py", line 205, in wrapper
    return f(*args)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/repository.py", line 346, in get_record
    metadata_formatter=formatter)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/repository.py", line 56, in serialize_get_record
    return serializers.serialize_get_record(data, metadata_formatter)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/validators.py", line 42, in wrapper
    res = f(*args, **kwargs)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/serializers.py", line 119, in serialize_get_record
    output = next(ppl.run(data, rewrap=True))
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/plumber.py", line 228, in run
    for out_data in iterable:
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/plumber.py", line 140, in __iter__
    for data in getattr(self, '_iterable_data', []):
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/plumber.py", line 141, in __iter__
    yield self.transform(data)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/serializers.py", line 432, in transform
    for rec in records:
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/serializers.py", line 431, in <genexpr>
    for resource in data.get('resources', []))
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/serializers.py", line 416, in make_record
    xmltree, _ = next(ppl.run((record, record_data), rewrap=True))
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/plumber.py", line 228, in run
    for out_data in iterable:
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/plumber.py", line 141, in __iter__
    yield self.transform(data)
  File "/Users/gustavofonseca/prj/envs/oai-pmh/lib/python3.6/site-packages/plumber.py", line 161, in transform
    return self.declared_function(data)
  File "/Users/gustavofonseca/prj/oai-pmh/oaipmh/serializers.py", line 351, in header
    if data.get('deleted', False) is True:
AttributeError: 'str' object has no attribute 'get'