[issue20246] buffer overflow in socket.recvfrom_into

2014-02-25 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I notified secur...@python.org and waited for the go-ahead (from Guido I think) before opening this bug. If today is the first that the PSRT is hearing about this, then the issue is broader than just the bugtracker

[issue20246] buffer overflow in socket.recvfrom_into

2014-01-20 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: The send part of the test doesn't matter, since what's being tested happens before any reads. The MSG multiplier should be removed completely, since none of the other tests do that. Patch attached. -- Added file: http://bugs.python.org/file33573

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I believe the feature you starred resolves this enhancement issue, in which case my patches are obsolete. And yes, the 'as' syntax makes a lot more sense. Here's how I hope it works (the arg parsing wrapper remains unchanged): foo: int ... _impl

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Yes, that makes more sense. The specific syntax is nearly irrelevant compared to the feature existing at all. You still haven't indicated whether your starred feature matches the *result* that I outlined. Does

[issue20252] Argument Clinic howto: small typo in y# translation

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I saw the fix for this in the commit stream. Closing. -- resolution: - fixed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20252

[issue20252] Argument Clinic howto: small typo in y# translation

2014-01-18 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20252 ___ ___ Python-bugs-list

[issue20246] buffer overflow in socket.recvfrom_into

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Perhaps the test is sending an infeasibly large message. If you remove the '*2048' does it pass? (I set up a FreeBSD 9.2 amd64 VM but all tests are passing here). -- ___ Python tracker rep...@bugs.python.org

[issue20299] Argument Clinic CConverter.__init__() overrides c_default and py_default

2014-01-18 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: The docs indicate that you can do: class foo_converter(CConverter): ... c_default = 'bar()' py_default = 'Bar' except that CConverter.__init__() unconditionally overwrites these values. Patch attached. -- components: Build files

[issue20300] Argument Clinic raises exception for custom converter with default

2014-01-18 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: 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

[issue20300] Argument Clinic raises exception for custom converter with default

2014-01-18 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- components: +Build type: - crash versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20300

[issue20299] Argument Clinic CConverter.__init__() overrides c_default and py_default

2014-01-18 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- nosy: +Nikratio ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20299 ___ ___ Python-bugs-list

[issue20299] Argument Clinic CConverter.__init__() overrides c_default and py_default

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: No, I'm happy. It isn't really news anyway, since the patch just brings reality inline with the docs :). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20299

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I have reviewed this as best I am able. I'll be honest that a lot of clinic.py makes my eyes cross; I'm used to webdev templating, which is inverted from AC (flow control inside the template). Not complaining, it's a complicated subject. I do like

[issue20260] Argument Clinic: add unsigned integers converters

2014-01-17 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: socketmodule has three builtins which use PyLong_AsUnsignedLong on their arguments and would benefit from these converters, but only if they raise OverflowError. So I vote for #2. I don't think it's unreasonable to continue to have locally-defined

[issue20292] clinic.py str_converter with encoding throws exception

2014-01-17 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: Find test file attached. The exception: Exception raised during parsing: Traceback (most recent call last): ... File proj/python/trunk.hg/Tools/clinic/clinic.py, line 1535, in render self.parse_argument(data.parse_arguments) File proj/python

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-16 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: The use case is primarily to minimize code churn for the derby, but since you're the one (heroically) doing the code review it's really your call. I whipped up a quick patch for this feature, and even if you remove c_name from __init__ I think it's still

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-16 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: Added file: http://bugs.python.org/file33494/argument_clinic_ensure_legal_cleanup.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-16 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Here's sendmsg with only nested bracket optional args. If Rietveld doesn't like this patch I may cry. -- Added file: http://bugs.python.org/file33496/argument_clinic_socketmodule_v4.patch ___ Python tracker rep

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-16 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: After all our discussions I'm closing this with resolution don't do that then. -- resolution: - wont fix status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20232

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Forgot to linewrap a paragraph. -- Added file: http://bugs.python.org/file33489/argument_clinic_socketmodule_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20174

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I've realized this is basically insoluble without PEP 457, because any other solution involves changing behavior (None being silently accepted where it would previously raise an exception). If that's OK, then per-function defensive programming is probably

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: sha1 is Vajrasky's module. I have a much more complicated example (and Vajrasky and I just both posted on python-dev separately about this issue): sockobj.sendmsg(buffers[, ancdata[, flags[, address]]]) - sockobj.sendmsg(buffers, ancdata=None, flags=0

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: No, that still leaves address broken since neither None nor an empty tuple are acceptable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20232

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-15 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Tweaked the argument list for functions using a NULL default. Kludgy but doesn't lie to the user. -- Added file: http://bugs.python.org/file33490/argument_clinic_socketmodule_v3.patch ___ Python tracker rep

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-14 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Here's the socketmodule patch. I aggressively imported text from the docs for the docstrings, along with matching parameter names, given how far the old docstrings have drifted over time. The Windows-specific code is untested, but otherwise the tests pass

[issue20202] ArgumentClinic howto: document change in Py_buffer lifecycle management

2014-01-13 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Even more imperative than my version. Excellent! -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20202

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-13 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- nosy: +rmsr ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20227 ___ ___ Python-bugs-list mailing

[issue20246] buffer overflow in socket.recvfrom_into

2014-01-13 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: recvfrom_into fails to check that the supplied buffer object is big enough for the requested read and so will happily write off the end. I will attach patches for 3.4 and 2.7, I'm not familiar with the backporting procedure to go further but all

[issue20246] buffer overflow in socket.recvfrom_into

2014-01-13 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: Added file: http://bugs.python.org/file33453/recvfrom_into_buffer_overflow_2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20246

[issue20246] buffer overflow in socket.recvfrom_into

2014-01-13 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- keywords: +patch Added file: http://bugs.python.org/file33452/recvfrom_into_buffer_overflow_3.4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20246

[issue20227] Argument Clinic: rename arguments in generated C?

2014-01-13 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Georg Brandl wrote: Although now is a good time to ensure sensible argument names (I usually look at the docs to find the documented ones), so that switching the function to keyword arg support is basically just a removal of '/' I started doing

[issue20248] docs: socket.recvmsg{,_into} are keword-compatible

2014-01-13 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: The docs indicate their arguments are positional-only. Trivial patch attached. -- assignee: docs@python components: Documentation files: docs_socket_recvmsg_args.patch keywords: patch messages: 208067 nosy: docs@python, rmsr priority: normal

[issue20248] docs: socket.recvmsg{,_into} are keword-compatible

2014-01-13 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Never mind, it's actually recvfrom{,_into}. Sigh. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20248

[issue20252] Argument Clinic howto: small typo in y# translation

2014-01-13 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: type - types -- assignee: docs@python components: Documentation files: argument_clinic_howto_y-hash.patch keywords: patch messages: 208076 nosy: docs@python, larry, rmsr priority: normal severity: normal status: open title: Argument Clinic howto

[issue20202] ArgumentClinic howto: document change in Py_buffer lifecycle management

2014-01-12 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Thank you for including the doc change in your other patch. As the grammar was off, instead of just fixing it I naturally rewrote it. Use this patch or just remove the extraneous for you as you prefer. -- keywords: +patch Added file: http

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-12 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Just discovered that the bugtracker mail was all going into my spam filter, yay. Didn't notice your reply until just now. The functools patch was just a quickie to get it out of my mental queue, and I'm still working on socketmodule. This is my first time

[issue20231] Argument Clinic accepts no-default args after default args

2014-01-12 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20231 ___ ___ Python-bugs-list mailing

[issue20231] Argument Clinic accepts no-default args after default args

2014-01-12 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: A signature of the form a: object = None b: object results in b being uninitialized in the generated C code prior to the PyArgs_ParseTuple call. If ParseTuple does not set a value for b (as it is an optional argument), b then contains a garbage pointer

[issue20232] Argument Clinic NULL default falsely implies None acceptability

2014-01-12 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: When one specifies a default of NULL, the generated signature doc indicates a default of None. However, if the user actually supplies None, perhaps as a placeholder in a positional-only call, C code which only checks for NULL will fail inappropriately

[issue20201] Argument Clinic: rwbuffer support broken

2014-01-10 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Accepts only a writable bytearray, when the function needs to mutate-in-place. The rw_buffer support is for PyPy I guess. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20201

[issue20203] ArgumentClinic: support middle optional argument

2014-01-09 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: socket.sendto is apparently even weirder than addch or range: the optional argument is in the *middle*. Attempting this configuration gets me: Function sendto has an unsupported group configuration. (Unexpected state 5) An expected unexpected

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-08 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: Taking a crack at this. socketmodule.h: just a comment, skipping. _functools.c: kind-of skipping, because the relevant functions are not normally directly called (pickle protocol __reduce__ and __setstate__ on partial, __call__ on cmp wrapper). Will add

[issue20200] Argument Clinic howto: custom self_converter example broken

2014-01-08 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: The custom converter declaration is wrapped with [clinic input] when it should be [python input]. Patch attached. -- files: argument_clinic_docfix.patch keywords: patch messages: 207724 nosy: rmsr priority: normal severity: normal status: open

[issue20174] Derby #5: Convert 50 sites to Argument Clinic across 3 files

2014-01-08 Thread Ryan Smith-Roberts
Changes by Ryan Smith-Roberts r...@lab.net: -- keywords: +patch Added file: http://bugs.python.org/file33372/argument_clinic_functools.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20174

[issue20201] Argument Clinic: rwbuffer support broken

2014-01-08 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I'm such a goofball, how about some bug metadata -- components: +Build type: - compile error versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20201

[issue20201] Argument Clinic: rwbuffer support broken

2014-01-08 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: Following the howto's instructions on the new syntax for the 'w*' argument, one gets an exception: ... File Tools/clinic/clinic.py, line 1780, in converter_init elif types == (bytearray_type | rwuffer_type): NameError: global name 'rwuffer_type

[issue20202] ArgumentClinic howto: document change in Py_buffer lifecycle management

2014-01-08 Thread Ryan Smith-Roberts
New submission from Ryan Smith-Roberts: Almost didn't catch that PyBuffer_Release isn't needed. Also we need a verb/adjective for applying AC. Cure? zlibmodule has already been cured. -- assignee: docs@python components: Documentation messages: 207728 nosy: docs@python, larry, rmsr