Re: NamedTemporaryFile does not match documentation

2013-02-22 Thread Serhiy Storchaka
On 22.02.13 07:57, Jason Friedman wrote: Yep, that looks like a docs bug (it was probably copied straight in from the 2.x docs). Nice and easy to fix, you could submit a patch with the bug report and make the devs love you! Done: http://bugs.python.org/issue17271. Fixed. Thank you. -- http:

Re: NamedTemporaryFile does not match documentation

2013-02-21 Thread Jason Friedman
> Yep, that looks like a docs bug (it was probably copied straight in > from the 2.x docs). Nice and easy to fix, you could submit a patch > with the bug report and make the devs love you! Done: http://bugs.python.org/issue17271. -- http://mail.python.org/mailman/listinfo/python-list

Re: NamedTemporaryFile does not match documentation

2013-02-21 Thread Chris Angelico
On Fri, Feb 22, 2013 at 1:10 PM, Jason Friedman wrote: >> NamedTemporaryFile by default opens a file in binary mode ('w+b'). Write >> bytes or specify text mode. >> > f.write(b"Hello World!\n") >> 13 > ft = NamedTemporaryFile('w+', delete=False) > ft.write("Hello World!\n") >> 13 > > T

Re: NamedTemporaryFile does not match documentation

2013-02-21 Thread Jason Friedman
> NamedTemporaryFile by default opens a file in binary mode ('w+b'). Write > bytes or specify text mode. > f.write(b"Hello World!\n") > 13 ft = NamedTemporaryFile('w+', delete=False) ft.write("Hello World!\n") > 13 Thank you Chris and Serhiy, that helped. I'm inclined to open a doc

Re: NamedTemporaryFile does not match documentation

2013-02-21 Thread Serhiy Storchaka
On 21.02.13 22:46, Jason Friedman wrote: Python 3.2.2 (default, Feb 14 2012, 08:06:31) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2 Type "help", "copyright", "credits" or "license" for more information. from tempfile import NamedTemporaryFile f = NamedTemporaryFile(delete=False) f f.name

Re: NamedTemporaryFile does not match documentation

2013-02-21 Thread Chris Angelico
On Fri, Feb 22, 2013 at 7:46 AM, Jason Friedman wrote: > Python 3.2.2 (default, Feb 14 2012, 08:06:31) > [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. from tempfile import NamedTemporaryFile f = NamedTemporaryFi