[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
Changes by Antoine Pitrou : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs

[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
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 ___ ___

[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 "", line 1, in TypeError: writelines() argument must be a sequence of strings While the commen

[issue21350] bug in file.writelines accepting buffers

2014-04-26 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns
Changes by Brian Kearns : Added file: http://bugs.python.org/file35037/fix_file_writelines-py27.patch ___ Python tracker ___ ___ Python-bugs-l

[issue21350] bug in file.writelines accepting buffers

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

[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 code/