Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-30 Thread dieter
Terry Reedy writes: > ... >> The problem seems to come from my expectation that a file >> is its own iterator and in python3 that is no longer true >> for a NamedTemporaryFile. > ... >> Should this be considered a bug? > > No. The doc for NamedTemporaryFile does not even claim

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread eryk sun
On Fri, Jul 29, 2016 at 7:34 PM, Terry Reedy wrote: > On 7/29/2016 7:59 AM, eryk sun wrote: >> >> On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon >> wrote: >>> >>> The problem seems to come from my expectation that a file >>> is its own iterator and

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread Terry Reedy
On 7/29/2016 7:59 AM, eryk sun wrote: On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon wrote: The problem seems to come from my expectation that a file is its own iterator and in python3 that is no longer true for a NamedTemporaryFile. For some reason it uses a

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread Terry Reedy
On 7/29/2016 4:43 AM, Antoon Pardon wrote: Below is a short program that illustrate the problem It works with python2, whether you use the -c option or not. It only works with python3 if you use the -c option. The problem seems to come from my expectation that a file is its own iterator and in

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread eryk sun
On Fri, Jul 29, 2016 at 8:43 AM, Antoon Pardon wrote: > > The problem seems to come from my expectation that a file > is its own iterator and in python3 that is no longer true > for a NamedTemporaryFile. For some reason it uses a generator function for __iter__

Re: TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-29 Thread Antoon Pardon
Below is a short program that illustrate the problem It works with python2, whether you use the -c option or not. It only works with python3 if you use the -c option. The problem seems to come from my expectation that a file is its own iterator and in python3 that is no longer true for a

TypeError: '_TemporaryFileWrapper' object is not an iterator

2016-07-27 Thread Antoon Pardon
rt.py", line 35, in loading ln = load(fl) File "/local/home/apardon/src/fietsroutes/route.py", line 366, in load return greep(next(fl)) TypeError: '_TemporaryFileWrapper' object is not an iterator Locals by frame, innermost last Frame main in /local/home/apardon/src/fiets