Skip to content

Re-opening open NamedTemporaryFile files won't work on Windows #6

@BramVanroy

Description

@BramVanroy

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:

PS C:\tools\eflomal> python .\align.py -s .\source.txt -t .\target.txt
Traceback (most recent call last):
  File ".\align.py", line 142, in <module>
    if __name__ == '__main__': main()
  File ".\align.py", line 136, in main
    use_gdb=args.debug)
  File "python\eflomal\eflomal.pyx", line 123, in eflomal.align
    with open(source_filename, 'rb') as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\user\\AppData\\Local\\Temp\\tmphqbksy6m'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions