[portland] Not Seeing Script Error(s)

Rich Shepard rshepard at appl-ecosys.com
Wed Nov 23 00:37:47 CET 2011

On Tue, 22 Nov 2011, Ethan Furman wrote:

> What's happening there is the two files are being opened, and then those
> open file objects are being handed into the csv.reader and csv.writer
> functions, and the result of the two csv.* calls are being assigned to
> 'reader' and 'output'.  Basically, the actual file objects are anonymous.

   That's what I thought.

> When reader and output go out of scope they are destroyed, and at that
> point the only references to the two open file objects are lost, and then
> the open file objects are closed by Python. Like I said, it's better to do
> it explicity.  ;)

   I always explicitly close files. So I'll re-write that code so file names
are available.



More information about the Portland mailing list