➜

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
标题: Derby: Convert the audioop module to use Argument Clinic
类型: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.4
process
状态: closed Resolution: fixed
Dependencies: 20142 20161 后续:
分配给: serhiy.storchaka 抄送列表: larry, python-dev, serhiy.storchaka
优先级: normal 关键字: patch

Created on 2014-01-05 21:21 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
audioop_clinic.patch serhiy.storchaka, 2014-01-18 12:49 review
Messages (10)
msg207401 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-05 21:21
Here is a patch which converts the audioop module to use Argument Clinic. 26 functions are converted. Also it adds docstrings for audioop functions.

There are two problems:

* Test test_string crashes. Perhaps here is a bug in Argument Clinic (Py_buffer arguments are not initialized).

* Pydoc for ratecv (and only for this function) returns:

    ratecv = <built-in function ratecv>
msg207595 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-07 20:54
Can you refresh the patch?  I think all the problems you cited are fixed, and also the comments Argument Clinic uses were all changed.  I'll review when you have a fresh patch.
msg207626 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-07 23:56
Here is refreshed patch.
msg207645 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-08 00:25
Serhiy: Assigning to you because you wrote a patch; if you don't want the issue, sorry, please undo it.
msg208084 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-14 08:59
Patch updated to tip (a little different generated code for Py_buffer).

I don't want to use return converters here because I want to add support for float32 and float64 in 3.5.
msg208245 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-16 07:24
I don't understand.  Python already has "double" which is float64.  Why would Python need a second floating-point type which isn't as good?

In any case, if somehow you get float32 in, we could just change the return converters then.  So I would still prefer float return converters for now.
msg208252 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-16 08:03
I mean I want to add support for float32 and float64 in audioop functions. In that case return value of getsample(), max(), ets will be no longer integer for float format.
msg209181 - (view) Author: Roundup Robot (python-dev) (Python triager) 日期: 2014-01-25 09:58
New changeset d4099b8a7d0f by Serhiy Storchaka in branch 'default':
Issue #20133: The audioop module now uses Argument Clinic.
http://hg.python.org/cpython/rev/d4099b8a7d0f
msg209261 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-26 00:24
Christian Heimes just posted this to python-dev:

____________________________________________________________

Coverity has detected an issue in this commit:


** CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in audioop_ratecv_impl()


________________________________________________________________________________________________________
*** CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
/Modules/audioop.c: 1375 in audioop_ratecv_impl()
1369                without spurious overflow is the challenge; we can
1370                settle for a reasonable upper bound, though, in this
1371                case ceiling(len/inrate) * outrate. */
1372
1373             /* compute ceiling(len/inrate) without overflow */
1374             Py_ssize_t q = len > 0 ? 1 + (len - 1) / inrate : 0;
>>>     CID 1164423:  Division or modulo by zero  (DIVIDE_BY_ZERO)
>>>     In expression "9223372036854775807L / q", division by expression
"q" which may be zero has undefined behavior.
1375             if (outrate > PY_SSIZE_T_MAX / q / bytes_per_frame)
1376                 str = NULL;
1377             else
1378                 str = PyBytes_FromStringAndSize(NULL,
1379                                                 q * outrate *
bytes_per_frame);
1380         }
msg209285 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-26 07:38
> Christian Heimes just posted this to python-dev:

See issue20394. This is unrelated to clicalization patch.
历史
日期 用户 动作 参数
2022-04-11 14:57:56admin修改github: 64332
2014-01-26 07:38:18serhiy.storchaka修改消息: + msg209285
2014-01-26 00:24:43larry修改消息: + msg209261
2014-01-25 10:01:08serhiy.storchaka修改状态: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-01-25 09:58:14python-dev修改抄送: + python-dev
消息: + msg209181
2014-01-18 12:49:53serhiy.storchaka修改文件: + audioop_clinic.patch
2014-01-18 12:48:37serhiy.storchaka修改文件: - audioop_clinic.patch
2014-01-18 12:48:04serhiy.storchaka修改文件: - audioop_clinic.patch
2014-01-18 12:47:09serhiy.storchaka修改文件: - audioop_clinic.patch
2014-01-16 08:03:13serhiy.storchaka修改消息: + msg208252
2014-01-16 07:24:15larry修改消息: + msg208245
2014-01-14 08:59:38serhiy.storchaka修改文件: + audioop_clinic.patch
2014-01-14 08:59:12serhiy.storchaka修改消息: + msg208084
2014-01-08 01:36:37r.david.murray链接issue20187 dependencies
2014-01-08 00:33:08larry解链issue20187 dependencies
2014-01-08 00:33:00larry链接issue20187 dependencies
2014-01-08 00:25:28larry修改assignee: serhiy.storchaka
消息: + msg207645
2014-01-07 23:56:51serhiy.storchaka修改文件: + audioop_clinic.patch

消息: + msg207626
2014-01-07 20:54:34larry修改消息: + msg207595
标题: Convert the audioop module to use Argument Clinic -> Derby: Convert the audioop module to use Argument Clinic
2014-01-07 09:40:11serhiy.storchaka修改dependencies: + inspect.signature fails on some functions which use Argument Clinic
2014-01-06 17:07:59serhiy.storchaka修改dependencies: + Argument Clinic: Py_buffer parameters are not initialized
2014-01-05 21:21:04serhiy.storchaka创建