Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--make-test-case cannot move ffsubsync.log because it's in use #93

Open
morpheus65535 opened this issue Aug 18, 2020 · 7 comments
Open

Comments

@morpheus65535
Copy link
Contributor

shutil.move('ffsubsync.log', tar_dir)

Result in PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'ffsubsync.log' under Windows.

@morpheus65535
Copy link
Contributor Author

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?

morpheus65535 added a commit to morpheus65535/ffsubsync that referenced this issue Aug 19, 2020
@morpheus65535
Copy link
Contributor Author

Log file location can be configured with #98

@smacke
Copy link
Owner

smacke commented Aug 21, 2020

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.

@smacke
Copy link
Owner

smacke commented Aug 21, 2020

Changed move to copy in c429270; will wait a bit and close this issue later in case there's any more issues.

@morpheus65535
Copy link
Contributor Author

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.

@smacke
Copy link
Owner

smacke commented Aug 26, 2020

@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.

@morpheus65535
Copy link
Contributor Author

morpheus65535 commented Aug 26, 2020

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. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants