[issue21350] bug in file.writelines accepting buffers

2016-05-29 Thread R. David Murray
R. David Murray added the comment: Unfortunately this caused a regression in unicode handling. See issue 27154. -- nosy: +r.david.murray ___ Python tracker

[issue21350] bug in file.writelines accepting buffers

2014-05-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the report and the patch! For a bit of trivia, this code has been there since 2000 (63ea2a2df06f). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350

[issue21350] bug in file.writelines accepting buffers

2014-05-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset db842f730432 by Antoine Pitrou in branch '2.7': Issue #21350: Fix file.writelines() to accept arbitrary buffer objects, as advertised. http://hg.python.org/cpython/rev/db842f730432 -- nosy: +python-dev

[issue21350] bug in file.writelines accepting buffers

2014-05-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350 ___

[issue21350] bug in file.writelines accepting buffers

2014-05-07 Thread Brian Kearns
Brian Kearns added the comment: So, for example: f = open('blah', 'wb') f.write(array.array('c', 'test')) f.writelines([array.array('c', 'test')]) Traceback (most recent call last): File stdin, line 1, in module TypeError: writelines() argument must be a sequence of strings While the

[issue21350] bug in file.writelines accepting buffers

2014-04-26 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350 ___ ___ Python-bugs-list

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
New submission from Brian Kearns: In file.writelines, the conditions in this if statement are bogus. If f-f_binary and AsReadBuffer succeeds (returns 0), AsCharBuf is still tried. So, for example, passing an array('c') to a file('wb').writelines fails, when it seems the intention of the

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file35036/fix_file_writelines-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350 ___

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Added file: http://bugs.python.org/file35037/fix_file_writelines-py27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21350 ___