Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Terry Reedy
On 10/10/2013 2:49 PM, Isaac Gerg wrote: Additionally, is there a place on the web to view this conversation and reply? Currently, I am only able to access this list through email. news.gmane.org newsgroup gmane.lang.python.general Look at the headers for this message. The site also has a sea

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread mapoe
On Thu, 10 Oct 2013 18:16:07 -0500, mapoe wrote: > On Thu, 10 Oct 2013 08:31:21 -0700, Isaac Gerg wrote: > >> I have a function that looks like the following: >> >> #- >> filename = 'c:\testfile.h5' >> f = open(filename,'r') >> data = f.read() > > it seems kind o

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread mapoe
On Thu, 10 Oct 2013 08:31:21 -0700, Isaac Gerg wrote: > I have a function that looks like the following: > > #- > filename = 'c:\testfile.h5' > f = open(filename,'r') > data = f.read() it seems kind of obvious from your sample: add: f.close() > q = multiprocessin

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
Hi Piet, Here is a real code example: http://stackoverflow.com/questions/948119/preventing-file-handle-inheritance-in-multiprocessing-lib As I said before, I had provide pseudocode. I cannot close the file after reading because it is part of a class and other threads may be calling member func

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Piet van Oostrum
Isaac Gerg writes: > Sorry, I am just providing pseudo code since I the code i have is quite large. > > As I mentioned, the code works fine when I remove the multirpcessing stuff so > the filename is not the issue (though you are right in your correction). > > Someone with the same problem poste

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
On Thu, Oct 10, 2013 at 2:49 PM, Isaac Gerg wrote: > > > > On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder wrote: > >> On 10/10/13 12:44 PM, Isaac Gerg wrote: >> >>> Sorry, I am just providing pseudo code since I the code i have is quite >>> large. >>> >>> As I mentioned, the code works fine when

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder wrote: > On 10/10/13 12:44 PM, Isaac Gerg wrote: > >> Sorry, I am just providing pseudo code since I the code i have is quite >> large. >> >> As I mentioned, the code works fine when I remove the multirpcessing >> stuff so the filename is not the iss

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Ned Batchelder
On 10/10/13 12:44 PM, Isaac Gerg wrote: Sorry, I am just providing pseudo code since I the code i have is quite large. As I mentioned, the code works fine when I remove the multirpcessing stuff so the filename is not the issue (though you are right in your correction). Someone with the same pr

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
Sorry, I am just providing pseudo code since I the code i have is quite large. As I mentioned, the code works fine when I remove the multirpcessing stuff so the filename is not the issue (though you are right in your correction). Someone with the same problem posted a smaller, more complete exam

Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Piet van Oostrum
Isaac Gerg writes: > I have a function that looks like the following: That doesn't look like a function > > #- > filename = 'c:\testfile.h5' Your filename is most probably wrong. It should be something like: filename = 'c:/testfile.h5' filename = 'c:\\testfile.

Python 3.2 | WIndows 7 -- Multiprocessing and files not closing

2013-10-10 Thread Isaac Gerg
I have a function that looks like the following: #- filename = 'c:\testfile.h5' f = open(filename,'r') data = f.read() q = multiprocessing.Queue() p = multiprocess.Process(target=myFunction,args=(data,q)) p.start() result = q.get() p.join() q.close() f.close() os