Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56600
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <isaac.gerg@gergltd.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'subject:Python': 0.06; 'mentioned,': 0.07; 'subject: -- ': 0.07; 'currently,': 0.09; 'filename': 0.09; 'pgp': 0.09; 'skip:# 30': 0.09; 'subject:files': 0.09; 'works.': 0.09; 'cc:addr:python- list': 0.11; 'suggest': 0.14; 'posted': 0.15; '"with"': 0.16; 'processes.': 0.16; 'skip:q 70': 0.16; '\xa0would': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'thu,': 0.19; '>>>': 0.22; 'example': 0.22; 'cc:addr:python.org': 0.22; 'convenient': 0.24; 'sorry,': 0.24; 'text,': 0.24; 'fine': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'this:': 0.26; 'van': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; "doesn't": 0.30; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'code': 0.31; "skip:' 10": 0.31; 'you?': 0.31; '>>>>': 0.31; 'large.': 0.31; 'writes:': 0.31; 'file': 0.32; 'probably': 0.32; 'stuff': 0.32; 'quite': 0.32; 'received:74.125.82': 0.34; 'problem': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'should': 0.36; 'list': 0.37; 'skip:& 10': 0.38; 'skip:[ 10': 0.38; 'issue': 0.38; 'pm,': 0.38; 'received:74.125': 0.39; 'remove': 0.60; 'most': 0.60; 'providing': 0.61; 'here:': 0.62; 'complete': 0.62; 'more': 0.64; 'skip:f 50': 0.65; 'reply': 0.66; 'obvious': 0.74; 'batchelder': 0.84; 'isaac': 0.84; 'subject:skip:M 10': 0.84; '2013': 0.98 |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=UfxSR4Z7UkuSb8HUptw+ptaYGA2TPixjJDQY5prM/xs=; b=ctkWPjfhlNXkL1YpeXEayeZKs87nR77/IasKBG3PEoIi4lsGkhCbQzqXGOOai/Ftch f7gKCvuJF7P9yrnvpTUshZdfVBmHfJrpiMUHBs+TpqnPPo+/VUESSxWl4TYVOX6Play2 /oPORaYq417jm6ockBJsCPJr59DdjxKHaLMjb3WXOWOgkR7IXRbf9jUG4JeRgM8zI9z5 IXMJifrUIllfJ2A5ALMzp7Sr0JYZjetd46/1wCogl2IZKlfrU2BO8yykx13ymLBdM801 EqmBn148uwMwfrww4JvdIf4sfYiXhMs7kZCmeuL09s2dOxnugbQEKri37IDmi3uF5wlb RgOw== |
| X-Gm-Message-State | ALoCoQklEFRxw3tEWZl8fjMTKGHRdtHp4n126/2PCO8ES0B3K9U0ptwDPZZpAYDLxDJrhU/J22r+ |
| X-Received | by 10.180.90.197 with SMTP id by5mr8979298wib.43.1381430998988; Thu, 10 Oct 2013 11:49:58 -0700 (PDT) |
| MIME-Version | 1.0 |
| X-Originating-IP | [146.186.247.30] |
| In-Reply-To | <5256F4C1.4050700@nedbatchelder.com> |
| References | <c9e59679-f9de-41e8-99e9-58a0d656b683@googlegroups.com> <m261t5xero.fsf@cochabamba.vanoostrum.org> <73f03f7c-6a0a-449c-af60-ab204844d578@googlegroups.com> <5256F4C1.4050700@nedbatchelder.com> |
| From | Isaac Gerg <isaac.gerg@gergltd.com> |
| Date | Thu, 10 Oct 2013 14:49:38 -0400 |
| Subject | Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing |
| To | Ned Batchelder <ned@nedbatchelder.com> |
| Content-Type | multipart/alternative; boundary=f46d0438eb6dfa036804e86777a2 |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.957.1381431340.18130.python-list@python.org> (permalink) |
| Lines | 189 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1381431340 news.xs4all.nl 15987 [2001:888:2000:d::a6]:42549 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:56600 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
On Thu, Oct 10, 2013 at 2:41 PM, Ned Batchelder <ned@nedbatchelder.com>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 issue (though you are right in your >> correction). >> >> Someone with the same problem posted a smaller, more complete example >> here: >> >> http://stackoverflow.com/**questions/948119/preventing-** >> file-handle-inheritance-in-**multiprocessing-lib<http://stackoverflow.com/questions/948119/preventing-file-handle-inheritance-in-multiprocessing-lib> >> >> None of the solutions posted work. >> > > (BTW: it's better form to reply beneath the original text, not above it.) > > None of the solutions try the obvious thing of closing the file before > spawning more processes. Would that work for you? A "with" statement is a > convenient way to do this: > > with open(filename,'r') as f: > data = f.read() > > The file is closed automatically when the with statement ends. > > --Ned. > > >> On Thursday, October 10, 2013 12:38:19 PM UTC-4, Piet van Oostrum wrote: >> >>> Isaac Gerg <isaac.gerg@gergltd.com> 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.h5' >>> >>> filename = r'c:\testfile.h5' >>> >>> -- >>> >>> Piet van Oostrum <piet@vanoostrum.org> >>> >>> WWW: http://pietvanoostrum.com/ >>> >>> PGP key: [8DAE142BE17999C4] >>> >> > I will try what you suggest and see if it works. 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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Isaac Gerg <isaac.gerg@gergltd.com> - 2013-10-10 08:31 -0700
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Piet van Oostrum <piet@vanoostrum.org> - 2013-10-10 12:38 -0400
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Isaac Gerg <isaac.gerg@gergltd.com> - 2013-10-10 09:44 -0700
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Ned Batchelder <ned@nedbatchelder.com> - 2013-10-10 14:41 -0400
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Isaac Gerg <isaac.gerg@gergltd.com> - 2013-10-10 14:49 -0400
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Isaac Gerg <isaac.gerg@gergltd.com> - 2013-10-10 15:00 -0400
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Piet van Oostrum <piet@vanoostrum.org> - 2013-10-10 15:38 -0400
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Isaac Gerg <isaac.gerg@gergltd.com> - 2013-10-10 14:15 -0700
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing Terry Reedy <tjreedy@udel.edu> - 2013-10-10 21:45 -0400
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing mapoe <matthias@kill.at> - 2013-10-10 18:16 -0500
Re: Python 3.2 | WIndows 7 -- Multiprocessing and files not closing mapoe <matthias@kill.at> - 2013-10-10 18:29 -0500
csiph-web