citeproc-py icon indicating copy to clipboard operation
citeproc-py copied to clipboard

no attribute 'single' (iso690-author-date-sk, oxford-centre-for-mission-studies-harvard)

Open Dreamsorcerer opened this issue 5 years ago • 4 comments

>>> import citeproc as c
>>> import citeproc_styles as cs
>>> s = c.CitationStylesStyle(cs.get_style_filepath("iso690-author-date-sk"))
>>> r = {'type': 'article', 'id': 'ref0', 'title': None, 'DOI': '10.1271/kagakutoseibutsu.51.483', 'author': [{'family': 'Ikeda', 'given': 'Ikuo'}], 'issued': {'date-parts': [[2013]]}, 'ISSN': '0453-073X', 'publisher': 'KAGAKU TO SEIBUTSU', 'container_title': 'KAGAKU TO SEIBUTSU', 'issue': '7', 'volume': '51', 'page': '483-495'}
>>> b = c.CitationStylesBibliography(s, c.source.json.CiteProcJSON([r]), c.formatter.html)
>>> b.register(c.Citation([c.CitationItem("ref0")]))
>>> str(b.bibliography()[0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/citeproc/frontend.py", line 105, in bibliography
    return self.style.render_bibliography(self.items)
  File "/usr/local/lib/python3.7/site-packages/citeproc/frontend.py", line 75, in render_bibliography
    return self.root.bibliography.render(citation_items)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 244, in render
    return self.layout.render_bibliography(citation_items)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 628, in render_bibliography
    text = self.format(self.wrap(self.render_children(item)))
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 569, in render_children
    text = child.render(item, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 1400, in render
    return child.render(item, context=context, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 1522, in render
    return self.render_children(item, context=context, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 569, in render_children
    text = child.render(item, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 98, in render
    return self.markup(self.process(*args, **kwargs))
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 1371, in process
    child_text = child.render(item, context=context, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 706, in render
    text, language = self.process(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 720, in process
    text = self.get_macro(self.get('macro')).render(item, context)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 587, in render
    sort_options=sort_options)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 569, in render_children
    text = child.render(item, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 1400, in render
    return child.render(item, context=context, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 1435, in render
    return self.render_children(item, context=context, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 569, in render_children
    text = child.render(item, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 98, in render
    return self.markup(self.process(*args, **kwargs))
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 1371, in process
    child_text = child.render(item, context=context, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 706, in render
    text, language = self.process(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 722, in process
    text = self._term(item)
  File "/usr/local/lib/python3.7/site-packages/citeproc/model.py", line 761, in _term
    text = term.single
AttributeError: 'NoneType' object has no attribute 'single'

Dreamsorcerer avatar May 18 '20 09:05 Dreamsorcerer

bump, I personally get this with APA as well. I think this was discussed in https://github.com/citeproc-py/citeproc-py/issues/38 and https://github.com/citeproc-py/citeproc-py/pull/45 but nothing was implemented yet to resolve this right?

JVickery-TBS avatar Mar 04 '25 20:03 JVickery-TBS

I'm not aware of anyone implementing anything. I think the solution is https://github.com/citeproc-py/citeproc-py/pull/45#issuecomment-170875057, and PRs are always accepted.

tmorrell avatar Mar 04 '25 20:03 tmorrell

@tmorrell okay sounds good, I will fork and reimplement PR45 and make a new PR tomorrow

JVickery-TBS avatar Mar 04 '25 21:03 JVickery-TBS

copy of https://github.com/citeproc-py/citeproc-py/issues/146 as well

JVickery-TBS avatar Mar 05 '25 14:03 JVickery-TBS