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: Argument Clinic raises exception for custom converter with default
Type: crash Stage: resolved
Components: Demos and Tools Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: larry Nosy List: larry, nikratio, python-dev, rmsr
Priority: normal Keywords:

Created on 2014-01-19 05:46 by rmsr, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ac_converter_test.c rmsr, 2014-01-19 05:46 test file that raises exception
Messages (4)
msg208448 - (view) Author: Ryan Smith-Roberts (rmsr) * Date: 2014-01-19 05:46
If a custom converter declares both default and converter class attributes, you get this exception (test file attached):

Exception raised during parsing:
Traceback (most recent call last):
  File "Tools/clinic/clinic.py", line 1445, in parse
    parser.parse(block)
  File "Tools/clinic/clinic.py", line 2738, in parse
    self.state(None)
  File "Tools/clinic/clinic.py", line 3468, in state_terminal
    self.function.docstring = self.format_docstring()
  File "Tools/clinic/clinic.py", line 3344, in format_docstring
    s += "".join(a)
TypeError: sequence item 2: expected str instance, NoneType found
msg208468 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-01-19 10:28
New changeset cc53c49d38c8 by Larry Hastings in branch 'default':
Issue #20300: Fix exception when setting conversion class member "default"
http://hg.python.org/cpython/rev/cc53c49d38c8
msg208469 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2014-01-19 10:28
Thanks for the report.  It was an easy fix.

That said, I can't say I'm excited by the idea of a custom converter with a built-in default value.  I hope you know what you're doing!
msg208473 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-01-19 11:01
New changeset d0e2437136f5 by Larry Hastings in branch 'default':
Improve fix for issue #20300.
http://hg.python.org/cpython/rev/d0e2437136f5
History
Date User Action Args
2022-04-11 14:57:57adminsetgithub: 64499
2014-01-19 11:01:51python-devsetmessages: + msg208473
2014-01-19 10:28:56larrysetstatus: open -> closed
messages: + msg208469

assignee: larry
components: + Demos and Tools, - Build
resolution: fixed
stage: resolved
2014-01-19 10:28:00python-devsetnosy: + python-dev
messages: + msg208468
2014-01-19 05:47:38rmsrsettype: crash
components: + Build
versions: + Python 3.4
2014-01-19 05:46:48rmsrcreate