Re: Help! File objects and scoping

2005-06-08 Thread bens
Dave Benjamin wrote: > Here's the problem: the "mmap" object doesn't have a reference to > "somefile", only to its file descriptor number. So, when getfile() goes > out of scope, there are no references left, and the file gets closed > automatically. That makes a lot of sense. It's now how I woul

Help! File objects and scoping

2005-06-07 Thread bens
reated in a local scope and returned. Why does that make a difference? The strangest thing about this, I think, is that the error printed out above, EnvironmentError, is listed in the docs under "only used as base classes for other exceptions". In other words, it's never supposed to be