ffsubsync
ffsubsync copied to clipboard
--make-test-case cannot move ffsubsync.log because it's in use
https://github.com/smacke/ffsubsync/blob/997749de8aac74ec19137a2e641b97ef1bba81ea/ffsubsync/ffsubsync.py#L49
Result in PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'ffsubsync.log' under Windows.
In fact, if I hardcode the ffsubsync.log full path, it works. Any idea?
Would it be possible to add an args to provide the log directory where we want ffsubsync.log to be created?
Log file location can be configured with #98
Thanks for the PR, I think another strategy might be to just copy it. I'll go ahead and change the move to a copy.
Changed move to copy in c429270; will wait a bit and close this issue later in case there's any more issues.
But #96 fix the issue of still open log. And, BTW, if you just move the log, it will just append new stuff and you'll get a big log for nothing in each test case.
@morpheus65535 do you mean to say if I just copy the log that I'll end up with a big log file? if so that's a good point. I went ahead and removed the log file in f8516c3 after the test archive is finished being created.
Thanks for the PR in #96, I went ahead and merged it.
Will keep this issue open a bit longer in case anything else crops up.
What I mean is that if you copy the log file instead of moving it, you'll be appending to this same file each time you sync a subtitles. When you were moving the file, you didn't had to take care of removing it because it was moved.
Now, with #96, log file handler is closed before packaging the test case tar.gz file. With that, you can keep the move and won't get into an open file exception again.
Of course you can copy the file and delete it but, IMHO, move is doing this just fine. ;-)