-
Notifications
You must be signed in to change notification settings - Fork 30
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
Re-opening open NamedTemporaryFile files won't work on Windows #6
Comments
i am facing the same problem did you find a solution? |
Alas, no. Did not get any feedback from authors. |
Hi, sorry I missed this. Unfortunately I don't have a Windows system to test on, so I can't debug this on my own. If anyone comes up with a portable solution I would be happy to accept it as a pull request. An emergency measure would be to add an option that creates a temporary file in a less secure way. Would that be acceptable for your use case? |
yes, I tried to add a specific location for the temp files but it did not work, please if you have any solution to specify the place it will be great. Many thanks |
This is apparently a difference between Unix and Windows, Windows doesn't allow you to open a NamedTemporaryFile again. As a workaround, you can add "delete=False" to the NamedTemporaryFiles calls and close the files before align function is called. This does mean the temp files aren't deleted, so you'll also need to add temp file cleanup after the align call. I'm experimenting with eflomal for use with a Windows-based tool, so I might be able to make the necessary changes and add them to the codebase later. |
I was hoping there was an aligner that actually worked on Windows, but unfortunately it doesn't. The first issue I bump into is the file handling.
On Windows you can't re-open
NamedTemporaryFile
files that are open - it will give a Permission Denied error.EDIT: I spoke before my turn. The issue seems more intricate than what I had assumed. Apologies. The issue remains, though.
Trace:
The text was updated successfully, but these errors were encountered: