STINNER Victor victor.stin...@haypocalc.com added the comment:
Commited to 3.2 (r82208), blocked in 3.1 (r82209).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8850
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8850
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
New (improved) version of the patch:
- Remove also w# format
- Write tests for w* format
--
Added file: http://bugs.python.org/file17670/remove_w_format-2.patch
___
Python tracker
STINNER Victor victor.stin...@haypocalc.com added the comment:
See also #8926.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8850
___
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
w# is not only useless but also not used in py3k source code. w is also not
used. Only w* is used by fnctl and socket modules.
The problem with w# is that the caller cannot release the buffer and so we
cannot lock the buffer. I
Antoine Pitrou pit...@free.fr added the comment:
I'd point out that w# is mostly useless too. It's supposed to return a
read-write buffer, but as the doc says it also doesn't support mutable
objects, since it isn't able to properly lock/pin the buffer; therefore it
probably doesn't support
STINNER Victor victor.stin...@haypocalc.com added the comment:
Attached patch removes w format, cleanups the code for w* and w# formats,
and update the documentation.
--
keywords: +patch
Added file: http://bugs.python.org/file17571/remove_w_format.patch
New submission from STINNER Victor victor.stin...@haypocalc.com:
w format is dangerous because it doesn't give the size of the buffer: the
caller may write outside the buffer (buffer overflow).
w* and w# formats are fine.
It looks like w format is not used in trunk nor py3k (only w# and w*).