New GitHub issue #94538 from erlend-aasland:<br>
<hr>
<pre>
**Bug report**
Argument Clinic does not work with custom destination files, for example given this clinic input:
```
destination test new file test.c.h
output push
output methoddef_define test
output parser_prototype test
output docstring_prototype test
```
<details>
<summary>Traceback</summary>
```console
$ python3.11 Tools/clinic/clinic.py -f test.c
Error in file "test.c" on line 224:
Exception raised during parsing:
Traceback (most recent call last):
File "Tools/clinic/clinic.py", line 2030, in parse
parser.parse(block)
^^^^^^^^^^^^^^^^^^^
File "Tools/clinic/clinic.py", line 4176, in parse
block.output.extend(self.clinic.language.render(clinic, block.signatures))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Tools/clinic/clinic.py", line 614, in render
return self.render_function(clinic, function)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Tools/clinic/clinic.py", line 1453, in render_function
destination.append(s)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Destination' object has no attribute 'append'
```
</details>
This occurs because AC tries to append to a buffer (`clinic.destination_buffers`), but it receives a `Destination` object instead. The failure is in the `output` directive parser; it incorrectly updates `clinic.destination_buffers` with the _destination object_, instead of using the result of `clinic.get_destination_buffer`.
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/94538">View on GitHub</a>
<p>Labels: type-bug, expert-argument-clinic</p>
<p>Assignee: </p>