[docs] [issue14586] TypeError: truncate() takes no keyword arguments

Guy Taylor report at bugs.python.org
Tue Apr 17 11:40:31 CEST 2012


Guy Taylor <thebigguy.co.uk at gmail.com> added the comment:

@Brandl truncate() was the issue I ran into, no other reason. I have started on the rest of the IO module tho. I know the patch is not working but I ran into problems with getting cpython to change functions from positional to keyword.

@all
cpython                | Python                        | Status
-----------------------+-------------------------------+-------
iobase_readlines       | readline(limit=-1)            | patch v2
iobase_readline        | readlines(hint=-1)            | patch v2
iobase_seek            | seek(offset, whence=SEEK_SET) | patch v2
iobase_truncate        | truncate(size=None)           | patch v2
fileio_seek            | seek(offset, whence=SEEK_SET) | patch v2
fileio_read            | read(n=-1)                    | patch v2
textiowrapper_read     | read(n=-1)                    | ToDo
textiowrapper_readline | readline(limit=-1)            | ToDo
textiowrapper_seek     | seek(offset, whence=SEEK_SET) | ToDo
textiowrapper_truncate | truncate(size=None)           | ToDo
textiobase_read        | read(n=-1)                    | ToDo
textiobase_readline    | readline(limit=-1)            | ToDo
{bufferedio.c}         |                               | ToDo
{bytesio.c}            |                               | ToDo
{stringio.c}           |                               | ToDo

ps.
I am using code from within other C files and http://docs.python.org/dev/extending/extending.html#keyword-parameters-for-extension-functions to base my patch on but I still get "x()" takes no keyword arguments". What have I missed/Are the docs correct?

----------
Added file: http://bugs.python.org/file25251/truncate.ver2.patch

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


More information about the docs mailing list