Re: File access denied after subprocess completion on Windows platform

2011-05-25 Thread Claudiu Nicolaie CISMARU
n False self.msleep(10) if final_rename: os.rename(sfilename, dfilename) return True Without self.msleep(10), (1) catches WindowsError: file access ... blah blah. Maybe at (2) can be an access violation, but it wasn't triggered yet in tests. I will mo

Re: File access denied after subprocess completion on Windows platform

2011-05-25 Thread Tim Golden
On 24/05/2011 21:18, Claudiu Nicolaie CISMARU wrote: Now. There is one more issue. Seems that on faster computers and/or Windows 7 (the Win32 thing I have tested on a HVM Xen machine with Windows XP) the os.rename is too fast after fp.close() and generates the same Exception. The code follows: c

Re: File access denied after subprocess completion on Windows platform

2011-05-24 Thread Terry Reedy
On 5/24/2011 4:18 PM, Claudiu Nicolaie CISMARU wrote: Seems that close_fds did the trick. Anyway, I read that description on the documentation last night but I think I was so tired that I understood that in Windows has no effect... :) Now. There is one more issue. Seems that on faster computers

Re: File access denied after subprocess completion on Windows platform

2011-05-24 Thread Claudiu Nicolaie CISMARU
> Seems that close_fds did the trick. Anyway, I read that description on > the documentation last night but I think I was so tired that I > understood that in Windows has no effect... :) Now. There is one more issue. Seems that on faster computers and/or Windows 7 (the Win32 thing I have tested

Re: File access denied after subprocess completion on Windows platform

2011-05-24 Thread Claudiu Nicolaie CISMARU
I'm quoting a message that I received on personal address and wasn't sent to list: > > try adding argument close_fds=True to subprocess.Popen > > harish > And Tim's message: > It's not quite clear from your description above whether you > can be sure that the called subprocess has closed all

Re: File access denied after subprocess completion on Windows platform

2011-05-24 Thread Tim Golden
On 24/05/2011 11:01, Claudiu Nicolaie CISMARU wrote: The problem appears when I close the called program (in our case calc.exe). The (1) part (the call of os.rename) raise an exception: (32, 'The process cannot access the file because it is being used by another process') [Error 32] The process

File access denied after subprocess completion on Windows platform

2011-05-24 Thread Claudiu Nicolaie CISMARU
Hello, I have a program that uses pyside for an QT interface and a thread that downloads a lot of files. The thread is created with QThread object. But my problem I don't think it's QT related. The thread retrieves with pycurl a file that contains a list of files and start to downloads them.

Re: Cross-platform detection of exceptions raised during file access via os, shutil, codecs, etc.

2010-06-09 Thread Thomas Jollans
On 06/09/2010 11:56 PM, pyt...@bdurham.com wrote: > I'm looking for some suggestions on how to detect exceptions raised > during common types of file access (os, shutil, codecs, etc.) on a > cross-platform basis. I'm looking for feedback relative to Python 2.6 > and 2.7 but

Cross-platform detection of exceptions raised during file access via os, shutil, codecs, etc.

2010-06-09 Thread python
I'm looking for some suggestions on how to detect exceptions raised during common types of file access (os, shutil, codecs, etc.) on a cross-platform basis. I'm looking for feedback relative to Python 2.6 and 2.7 but would also appreciate hearing of any Python 3.x specific behaviors. Un

Re: File access

2007-08-02 Thread JD
Thanks for the suggestion, I am thinking implement a database system for that. JD On Aug 2, 12:11 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > JD wrote: > > Hi, > > > What I am trying to do is to run a subprocess on another machine using > > subprocess.Popen, this subprocess contuinue writing som

Re: File access

2007-08-02 Thread Larry Bates
JD wrote: > Hi, > > What I am trying to do is to run a subprocess on another machine using > subprocess.Popen, this subprocess contuinue writing something into a > file when it is runing. > > After submit this subprocess, I tried to open the file and readlines() > in the loop (with a delay) in th

Re: File access

2007-08-02 Thread JD
Thanks for answering, No, the data was writing into the file when the subprocess was runing. For example, every second it will write something into the file. I tried to run another python program aside and it sucessfully read the file when the subprocess was runing. JD On Aug 2, 11:00 am, Adri

Re: File access

2007-08-02 Thread Adrian Petrescu
On Aug 2, 12:41 pm, JD <[EMAIL PROTECTED]> wrote: > Hi, > > What I am trying to do is to run a subprocess on another machine using > subprocess.Popen, this subprocess contuinue writing something into a > file when it is runing. > > After submit this subprocess, I tried to open the file and readline

File access

2007-08-02 Thread JD
Hi, What I am trying to do is to run a subprocess on another machine using subprocess.Popen, this subprocess contuinue writing something into a file when it is runing. After submit this subprocess, I tried to open the file and readlines() in the loop (with a delay) in the loop) when the subproces

Re: threads, file access and stuff

2006-08-04 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Hi, > i'm trying to make a download manager (getright, flashget, etc..) for > linux (pygtk), i'm using pyCurl, so the thing is.. > the app need to be able to use mirrors, like : i download the first 400 > kb from X, and the second 200 kb from Y and the rest from Z. > i've

threads, file access and stuff

2006-08-03 Thread [EMAIL PROTECTED]
Hi, i'm trying to make a download manager (getright, flashget, etc..) for linux (pygtk), i'm using pyCurl, so the thing is.. the app need to be able to use mirrors, like : i download the first 400 kb from X, and the second 200 kb from Y and the rest from Z. i've plan to do this with threads and usi

Re: file access dialog

2005-08-26 Thread Wouter van Ooijen (www.voti.nl)
>Tkinter has a file acces dialog available with the same API on all platforms. >It is also mapped to the standard dialog on Windows. > Since Tkinter is certainly installed by default with Python, if a file dialog > is everything you need, you probably don't have to look further. Great :) Wout

Re: file access dialog

2005-08-26 Thread utabintarbo
For simple, it's hard to beat EasyGUI: http://www.ferg.org/easygui/ Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: file access dialog

2005-08-26 Thread Fredrik Lundh
Wouter van Ooijen wrote: >I have a tool in Python to which I want to add a small GUI. The tools > currently runs everywhere PySerial is supported. I need a file-access > dialog. What is the preffered way to to this? Is there a > platform-independent file-access dialog available, or

Re: file access dialog

2005-08-26 Thread Eric Brunel
On Fri, 26 Aug 2005 07:52:06 GMT, Wouter van Ooijen (www.voti.nl) <[EMAIL PROTECTED]> wrote: > I have a tool in Python to which I want to add a small GUI. The tools > currently runs everywhere PySerial is supported. I need a file-access > dialog. What is the preffered way to to t

Re: file access dialog

2005-08-26 Thread Adriaan Renting
CTED]> 08/26/05 9:52 am >>> I have a tool in Python to which I want to add a small GUI. The tools currently runs everywhere PySerial is supported. I need a file-access dialog. What is the preffered way to to this? Is there a platform-independent file-access dialog available, or should

file access dialog

2005-08-26 Thread Wouter van Ooijen (www.voti.nl)
I have a tool in Python to which I want to add a small GUI. The tools currently runs everywhere PySerial is supported. I need a file-access dialog. What is the preffered way to to this? Is there a platform-independent file-access dialog available, or should I use the windows native version when