This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ast.get_docstring(): AttributeError: 'NoneType' object has no attribute 'expandtabs'
Type: behavior Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jwilk, mbussonn, methane
Priority: normal Keywords:

Created on 2017-02-23 21:50 by jwilk, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 267 merged mbussonn, 2017-02-24 00:58
Messages (2)
msg288488 - (view) Author: Jakub Wilk (jwilk) Date: 2017-02-23 21:50
With git master (4c78c527d215c37472145152cb0e95f196cdddc9) I get this:

>>> import ast
>>> ast.get_docstring(ast.parse(''))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jwilk/opt/lib/python3.7/ast.py", line 203, in get_docstring
    text = inspect.cleandoc(text)
  File "/home/jwilk/opt/lib/python3.7/inspect.py", line 590, in cleandoc
    lines = doc.expandtabs().split('\n')
AttributeError: 'NoneType' object has no attribute 'expandtabs'
msg290414 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2017-03-24 23:49
New changeset 41cea70aa38de50c1d714209aa2b7694d86a7e0c by INADA Naoki (Matthias Bussonnier) in branch 'master':
bpo-29637: clean docstring only if not None (GH-267)
https://github.com/python/cpython/commit/41cea70aa38de50c1d714209aa2b7694d86a7e0c
History
Date User Action Args
2022-04-11 14:58:43adminsetgithub: 73823
2017-03-24 23:49:05methanesetmessages: + msg290414
2017-02-25 17:52:34methanesetstatus: open -> closed
resolution: fixed
stage: resolved
2017-02-24 00:58:16mbussonnsetpull_requests: + pull_request239
2017-02-23 23:52:24mbussonnsetnosy: + mbussonn
2017-02-23 21:50:11jwilkcreate