msg177477 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2012-12-14 17:37 |
Inadvertently strings accepted as arguments of audioop functions. This is a meaningless behavior and remnant of Python 2. We should drop string support. |
|
|
msg177487 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2012-12-14 18:22 |
What happens if you pass strings? If it doesn't work we can just fix it to raise an exception and stop returning random results, if it works but bytes should be used instead, we should go through a deprecation process. |
|
|
msg177488 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2012-12-14 18:29 |
> What happens if you pass strings? They are encoded with UTF-8. See 's#' and 's*' formats in PyArg_ParseTuple() ('y*' recommended for bytes). |
|
|
msg177513 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2012-12-14 21:27 |
Accepting Unicode strings is surprising and must fail. I don't think that a deprecation process is required here. |
|
|
msg177515 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2012-12-14 21:37 |
> Accepting Unicode strings is surprising and must fail. I don't think that a deprecation process is required here. Should it be fixed in 3.4 only or in all 3.x? |
|
|
msg177516 - (view) |
Author: Ezio Melotti (ezio.melotti) *  |
Date: 2012-12-14 21:43 |
The deprecation process can be avoided only if passing strings results in a meaningless result. If there are cases where users are passing strings and everything works fine -- even if they should be passing bytes instead -- we should deprecate strings first to warn the users that the "feature" is going to be removed. |
|
|
msg177517 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2012-12-14 21:51 |
In 2.x it was have a little sense (if you use some 8-bit encoding as default encoding, but the default was 7-bit ascii). But with utf-8 it doesn't have sense and should quickly lead to an unexpected result (or just fail in most cases). |
|
|
msg177522 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2012-12-15 00:00 |
> Should it be fixed in 3.4 only or in all 3.x? Such change cannot be done in a minor release (like 3.3.x), so it can only be done in Python 3.4. |
|
|
msg200556 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-10-20 10:01 |
Here is a patch. Now audioop functions no more accept str, but accept bytes-like objects instead. |
|
|
msg200675 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-10-21 00:38 |
audioop_buffer.patch: In general, I don't like goto in C. But to cleanup something when exiting a function, I like goto to implement something similar to Python try/finally. What do you think Serhiy? |
|
|
msg200738 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-10-21 09:45 |
Well. In updated patch I use gotos where it decreases the number of lines (total decreasing is almost 30 lines). |
|
|
msg202499 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-11-09 20:35 |
If there are no objections I will commit last patch tomorrow. |
|
|
msg202560 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-11-10 19:45 |
New changeset bab0cbf86835 by Serhiy Storchaka in branch 'default': Issue #16685: Added support for any bytes-like objects in the audioop module. http://hg.python.org/cpython/rev/bab0cbf86835 |
|
|
msg202596 - (view) |
Author: Jason R. Coombs (jaraco) *  |
Date: 2013-11-11 02:01 |
The patch as committed causes the Windows 64-bit builds to fail to compile. http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/3187/steps/compile/logs/stdio |
|
|
msg202606 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-11-11 05:52 |
New changeset 35cd00465624 by Serhiy Storchaka in branch 'default': Fixed compile error on Windows caused by arithmetic with void * pointers http://hg.python.org/cpython/rev/35cd00465624 |
|
|
msg202635 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-11-11 17:54 |
Fixed. Thank you Jason. |
|
|
msg203030 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-11-16 12:02 |
New changeset b96f4ee1b08b by Serhiy Storchaka in branch 'default': Issue #16685: Added support for writing any bytes-like objects in the aifc, http://hg.python.org/cpython/rev/b96f4ee1b08b |
|
|
msg213004 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-03-10 01:35 |
New changeset c375697f062e by R David Murray in branch 'default': whatsnew: auidioop.byteswap (#16685). http://hg.python.org/cpython/rev/c375697f062e |
|
|