Skip to content

Fails on filenames including more than one '.' #2

@cosmocracy

Description

@cosmocracy

When attempting to handle filenames/filepaths that include more than one '.' character, the library infers the wrong file type since it arbitrarily looks for the "qvd"/"xml" extension after the first period. Better to use a regular expression to make this determination. I fixed a fork of this by revising qvdfile.py by adding:

import re

And changing line 25 to:

self.mode = os.O_RDONLY if re.match('^.*qvd$', name, re.IGNORECASE) else os.O_WRONLY

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