Jump to content

So I have been tasked with fixing a script, it sends emails from files then renames them with done_ at the start.

 

The weird part is this works fine on my Linux and on my windows 7 VM but when on the VPN (2008 r2) i am getting file is being used by another process, all read/writes are closed as I'm using with open('file') and the renaming is done after the with open.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
https://linustechtips.com/topic/818289-python-weird-file-access-bug/
Share on other sites

Link to post
Share on other sites

16 hours ago, Erik Sieghart said:

That is interesting. Is there any way you can figure which process has it locked?

Not actually sure :/ another weird thing is running it from Idle works just fine but running it from CMD causes the error

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites

19 hours ago, Erik Sieghart said:

Are you reading the file by bytes or are they text?

they are text, after it sends an email it uses os to rename the file to done_filename.txt

 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×