[issue20381] Argument Clinic: expression default arguments broken

Zachary Ware report at bugs.python.org
Fri Jan 24 17:02:57 CET 2014


New submission from Zachary Ware:

The fix for #20189 broke simple expression defaults.  Specifically, with the latest #20172 patch applied, Clinic fails on winreg.c at winreg line 1351 with this traceback:

Error in file "PC\winreg.c" on line 1351:
Exception raised during parsing:
Traceback (most recent call last):
  File "Tools\clinic\clinic.py", line 1541, in parse
    parser.parse(block)
  File "Tools\clinic\clinic.py", line 2942, in parse
    self.state(line)
  File "Tools\clinic\clinic.py", line 3482, in state_parameter_docstring
    return self.next(self.state_parameter, line)
  File "Tools\clinic\clinic.py", line 2975, in next
    self.state(line)
  File "Tools\clinic\clinic.py", line 3321, in state_parameter
    bad = default != repr(eval(default))
  File "<string>", line 1, in <module>
NameError: name 'winreg' is not defined

In this case, 'default' is 'winreg.KEY_WRITE'.  The 'default != repr(eval(default))' check cannot succeed with such a default even if winreg were defined, as it will return an int, 131078.

----------
assignee: larry
components: Demos and Tools
messages: 209094
nosy: larry, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Argument Clinic: expression default arguments broken
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20381>
_______________________________________


More information about the Python-bugs-list mailing list